Commit 679ca6bc authored by Serhiy Storchaka's avatar Serhiy Storchaka

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

parent 7f16ce19
...@@ -278,8 +278,9 @@ class ReloadTests(unittest.TestCase): ...@@ -278,8 +278,9 @@ class ReloadTests(unittest.TestCase):
def test_with_deleted_parent(self): def test_with_deleted_parent(self):
# see #18681 # see #18681
from html import parser from html import parser
del sys.modules['html'] html = sys.modules.pop('html')
def cleanup(): del sys.modules['html.parser'] def cleanup():
sys.modules['html'] = html
self.addCleanup(cleanup) self.addCleanup(cleanup)
with self.assertRaisesRegex(ImportError, 'html'): with self.assertRaisesRegex(ImportError, 'html'):
imp.reload(parser) imp.reload(parser)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment