summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_importhooks.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_importhooks.py b/Lib/test/test_importhooks.py
index 9304213..847f089 100644
--- a/Lib/test/test_importhooks.py
+++ b/Lib/test/test_importhooks.py
@@ -212,6 +212,13 @@ class ImportHooksTestCase(ImportHooksBaseTestCase):
for mname in mnames:
m = __import__(mname, globals(), locals(), ["__dummy__"])
m.__loader__ # to make sure we actually handled the import
+ # Delete urllib from modules because urlparse was imported above.
+ # Without this hack, test_socket_ssl fails if run in this order:
+ # regrtest.py test_codecmaps_tw test_importhooks test_socket_ssl
+ try:
+ del sys.modules['urllib']
+ except KeyError:
+ pass
def test_main():
test_support.run_unittest(ImportHooksTestCase)