test_struct grew weird behavior under regrtest.py -R,

due to a module-level cache.  Clearing the cache should
make it stop showing up in refleak reports.
This commit is contained in:
Tim Peters 2006-05-23 21:51:35 +00:00
parent 7763351808
commit 1bddfb84ee
1 changed files with 2 additions and 0 deletions

View File

@ -545,6 +545,7 @@ def runtest(test, generate, verbose, quiet, testdir=None, huntrleaks=False):
def cleanup(): def cleanup():
import _strptime, linecache, warnings, dircache import _strptime, linecache, warnings, dircache
import urlparse, urllib, urllib2, mimetypes, doctest import urlparse, urllib, urllib2, mimetypes, doctest
import struct
from distutils.dir_util import _path_created from distutils.dir_util import _path_created
_path_created.clear() _path_created.clear()
warnings.filters[:] = fs warnings.filters[:] = fs
@ -561,6 +562,7 @@ def runtest(test, generate, verbose, quiet, testdir=None, huntrleaks=False):
dircache.reset() dircache.reset()
linecache.clearcache() linecache.clearcache()
mimetypes._default_mime_types() mimetypes._default_mime_types()
struct._cache.clear()
doctest.master = None doctest.master = None
if indirect_test: if indirect_test:
def run_the_test(): def run_the_test():