[FIX] testfile: can import during iteration
Hence modifying sys.modules blowing up the iterator.
This commit is contained in:
@@ -874,7 +874,7 @@ def load_test_file_yml(registry, test_file):
|
||||
def load_test_file_py(registry, test_file):
|
||||
# Locate python module based on its filename and run the tests
|
||||
test_path, _ = os.path.splitext(os.path.abspath(test_file))
|
||||
for mod_name, mod_mod in pycompat.items(sys.modules):
|
||||
for mod_name, mod_mod in list(pycompat.items(sys.modules)):
|
||||
if mod_mod:
|
||||
mod_path, _ = os.path.splitext(getattr(mod_mod, '__file__', ''))
|
||||
if test_path == mod_path:
|
||||
|
||||
Reference in New Issue
Block a user