diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 7675a97b5b48ee..23666c30617c88 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -434,7 +434,7 @@ def run_tests_sequential(self): # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): - if module not in save_modules and module.startswith("test."): + if module not in save_modules: support.unload(module) if self.ns.failfast and is_failed(result, self.ns):