File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/confcom/azext_confcom/tests Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1414import shutil
1515
1616from 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__ ]
You can’t perform that action at this time.
0 commit comments