Issue #18706: Fix a test for issue #18681 so it no longer breaks test_codeccallbacks*.

This commit is contained in:
Serhiy Storchaka 2013-08-11 20:13:36 +03:00
commit 3ee11407f8
1 changed files with 3 additions and 2 deletions

View File

@ -317,8 +317,9 @@ class ReloadTests(unittest.TestCase):
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)