mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Cleanup a bit more references so test_urllibnet is stable (test_urllib2 is sometimes stable, at least in isolation)
This commit is contained in:
parent
7025ce6fb0
commit
545d4962f5
1 changed files with 4 additions and 2 deletions
|
@ -490,8 +490,8 @@ def runtest(test, generate, verbose, quiet, testdir=None, huntrleaks=False):
|
||||||
pic = sys.path_importer_cache.copy()
|
pic = sys.path_importer_cache.copy()
|
||||||
import gc
|
import gc
|
||||||
def cleanup():
|
def cleanup():
|
||||||
import _strptime, urlparse, warnings, dircache
|
import _strptime, linecache, warnings, dircache
|
||||||
import linecache
|
import urlparse, urllib, urllib2
|
||||||
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
|
||||||
|
@ -499,6 +499,8 @@ def runtest(test, generate, verbose, quiet, testdir=None, huntrleaks=False):
|
||||||
sre.purge()
|
sre.purge()
|
||||||
_strptime._regex_cache.clear()
|
_strptime._regex_cache.clear()
|
||||||
urlparse.clear_cache()
|
urlparse.clear_cache()
|
||||||
|
urllib.urlcleanup()
|
||||||
|
urllib2.install_opener(None)
|
||||||
copy_reg.dispatch_table.clear()
|
copy_reg.dispatch_table.clear()
|
||||||
copy_reg.dispatch_table.update(ps)
|
copy_reg.dispatch_table.update(ps)
|
||||||
sys.path_importer_cache.clear()
|
sys.path_importer_cache.clear()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue