mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #18193: Add importlib.reload(), documenting (but not
implementing in code) the deprecation of imp.reload(). Thanks to Berker Peksag for the patch.
This commit is contained in:
parent
6f1057605b
commit
3fe35e6503
6 changed files with 122 additions and 24 deletions
|
@ -151,6 +151,18 @@ class FindLoaderTests(unittest.TestCase):
|
|||
self.assertIsNone(importlib.find_loader('nevergoingtofindthismodule'))
|
||||
|
||||
|
||||
class ReloadTests(unittest.TestCase):
|
||||
|
||||
"""Test module reloading for builtin and extension modules."""
|
||||
|
||||
def test_reload_modules(self):
|
||||
for mod in ('tokenize', 'time', 'marshal'):
|
||||
with self.subTest(module=mod):
|
||||
with support.CleanImport(mod):
|
||||
module = importlib.import_module(mod)
|
||||
importlib.reload(module)
|
||||
|
||||
|
||||
class InvalidateCacheTests(unittest.TestCase):
|
||||
|
||||
def test_method_called(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue