mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
This commit is contained in:
parent
d51914c6c1
commit
b212291b08
1 changed files with 3 additions and 2 deletions
|
@ -278,8 +278,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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue