mirror of https://github.com/python/cpython
This commit is contained in:
commit
3ee11407f8
|
@ -317,8 +317,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)
|
||||||
|
|
Loading…
Reference in New Issue