Skip to content

Commit e68637d

Browse files
clean up sys.modules between tests
1 parent 5a1459e commit e68637d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test_shadowed_module.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ def test_shadowed_modules_when_importing_integrations(
9999
source = pathlib.Path(spec.origin).read_text(encoding="utf-8")
100100
tree = ast.parse(source, filename=spec.origin)
101101
integration_dependencies = find_unrecognized_dependencies(tree)
102+
102103
for dependency in integration_dependencies:
103104
sys.modules[dependency] = types.ModuleType(dependency)
104105
with pytest.raises(integrations.DidNotEnable):
105106
importlib.import_module(module_path)
107+
108+
for dependency in integration_dependencies:
109+
del sys.modules[dependency]

0 commit comments

Comments
 (0)