[Python-checkins] cpython (3.3): Issue #18706: Fix a test for issue #18681 so it no longer breaks

serhiy.storchaka python-checkins at python.org
Sun Aug 11 19:14:25 CEST 2013


http://hg.python.org/cpython/rev/dab790a17c4d
changeset:   85122:dab790a17c4d
branch:      3.3
parent:      85119:e0f86c3b3685
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sun Aug 11 20:12:20 2013 +0300
summary:
  Issue #18706: Fix a test for issue #18681 so it no longer breaks test_codeccallbacks*.

files:
  Lib/test/test_imp.py |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -278,8 +278,9 @@
     def test_with_deleted_parent(self):
         # see #18681
         from html import parser
-        del sys.modules['html']
-        def cleanup(): del sys.modules['html.parser']
+        html = sys.modules.pop('html')
+        def cleanup():
+            sys.modules['html'] = html
         self.addCleanup(cleanup)
         with self.assertRaisesRegex(ImportError, 'html'):
             imp.reload(parser)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list