Correct an apparent refleak in test_pkgutil: zipimport._zip_directory_cache contains

info for all processed zip files, even when they are no longer used.
This commit is contained in:
Amaury Forgeot d'Arc 2008-04-20 21:02:21 +00:00
parent d6d5148b44
commit eac43afdc9
1 changed files with 3 additions and 0 deletions

View File

@ -122,6 +122,9 @@ class PkgutilPEP302Tests(unittest.TestCase):
def test_main():
run_unittest(PkgutilTests, PkgutilPEP302Tests)
# this is necessary if test is run repeated (like when finding leaks)
import zipimport
zipimport._zip_directory_cache.clear()
if __name__ == '__main__':
test_main()