summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pkgutil.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_pkgutil.py')
-rw-r--r--Lib/test/test_pkgutil.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py
index 7a1cd41..aaa9d8d 100644
--- a/Lib/test/test_pkgutil.py
+++ b/Lib/test/test_pkgutil.py
@@ -349,6 +349,11 @@ class ImportlibMigrationTests(unittest.TestCase):
def test_main():
run_unittest(PkgutilTests, PkgutilPEP302Tests, ExtendPathTests,
NestedNamespacePackageTest, ImportlibMigrationTests)
+ # this is necessary if test is run repeated (like when finding leaks)
+ import zipimport
+ import importlib
+ zipimport._zip_directory_cache.clear()
+ importlib.invalidate_caches()
if __name__ == '__main__':