Skip to content

Commit 04c40de

Browse files
committed
Fix merge conflict from previous commits
1 parent f6fd9f5 commit 04c40de

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/confcom/azext_confcom/tests/conftest.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import shutil
1515

1616
from pathlib import Path
17+
import zipfile
1718

1819

1920
# This fixture ensures tests are run against final built wheels of the extension
@@ -68,7 +69,15 @@ def run_on_wheel(request):
6869

6970
# Add the wheel to the path and reload extension modules so the
7071
# tests pick up the wheel code over the unbuilt code
71-
sys.path.insert(0, build_dir.glob("*.whl").__next__().as_posix())
72+
wheel_path = next(build_dir.glob("*.whl"))
73+
74+
expanded_dir = build_dir / f"{wheel_path.stem}_expanded"
75+
if not expanded_dir.exists():
76+
expanded_dir.mkdir(exist_ok=True)
77+
with zipfile.ZipFile(wheel_path, "r") as z:
78+
z.extractall(expanded_dir)
79+
80+
sys.path.insert(0, expanded_dir.resolve().as_posix())
7281
for module in list(sys.modules.values()):
7382
if extension in module.__name__ and module not in modules_to_test:
7483
del sys.modules[module.__name__]

0 commit comments

Comments
 (0)