Skip to content

Commit 218ee90

Browse files
committed
Fix the testing for built package
1 parent 646e4a5 commit 218ee90

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/confcom/azext_confcom/command/__init__.py

Whitespace-only changes.

src/confcom/azext_confcom/tests/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,16 @@ def run_on_wheel(request):
7979
with zipfile.ZipFile(wheel_path, "r") as z:
8080
z.extractall(expanded_dir)
8181

82-
sys.path.insert(0, expanded_dir.resolve().as_posix())
82+
for idx, path in enumerate(sys.path):
83+
if "src/confcom" in path:
84+
sys.path[idx] = expanded_dir.resolve().as_posix()
8385
for module in list(sys.modules.values()):
8486
if (
8587
extension in module.__name__ and
8688
not any (m.__name__.startswith(module.__name__) for m in modules_to_test)
8789
):
8890
del sys.modules[module.__name__]
91+
assert importlib.util.find_spec(module.__name__).origin # This catches modules not in the built packages
8992
importlib.import_module(module.__name__)
9093

9194
yield

0 commit comments

Comments
 (0)