summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pkgutil.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-02-16 19:52:01 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-02-16 19:52:01 (GMT)
commitcf626032763077bf959937705ed35f9e2b40a862 (patch)
treebed221f523db3a118706cc9bf1a451b6e0aebcae /Lib/test/test_pkgutil.py
parenteb43736de2a746369dd42f406bc705ec413f2e72 (diff)
downloadcpython-cf626032763077bf959937705ed35f9e2b40a862.zip
cpython-cf626032763077bf959937705ed35f9e2b40a862.tar.gz
cpython-cf626032763077bf959937705ed35f9e2b40a862.tar.bz2
backout fafac90b69c4
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 0db4fc6..fd06614 100644
--- a/Lib/test/test_pkgutil.py
+++ b/Lib/test/test_pkgutil.py
@@ -338,6 +338,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__':