[Python-checkins] r42842 - python/trunk/Lib/test/test_importhooks.py
neal.norwitz
python-checkins at python.org
Sun Mar 5 00:13:42 CET 2006
Author: neal.norwitz
Date: Sun Mar 5 00:13:41 2006
New Revision: 42842
Modified:
python/trunk/Lib/test/test_importhooks.py
Log:
Fix spurious test failure of test_socket_ssl when run in this order:
test_codecmaps_tw test_importhooks test_socket_ssl
I don't completely understand the cause, but there's a lot of import magic
going on and this is the smallest change which fixes the problem.
Modified: python/trunk/Lib/test/test_importhooks.py
==============================================================================
--- python/trunk/Lib/test/test_importhooks.py (original)
+++ python/trunk/Lib/test/test_importhooks.py Sun Mar 5 00:13:41 2006
@@ -252,6 +252,10 @@
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
+ del sys.modules['urllib']
def test_main():
test_support.run_unittest(ImportHooksTestCase)
More information about the Python-checkins
mailing list