diff options
author | Brett Cannon <brett@python.org> | 2013-06-14 19:04:26 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-06-14 19:04:26 (GMT) |
commit | 3fe35e65034de82c45e2d8fe1ebe4a2929c68453 (patch) | |
tree | 5417c105714337f251daf3eb8be5f6762d273d99 /Lib/test/test_importlib/test_api.py | |
parent | 6f1057605b26c34b30c562a1b620984ed1211f39 (diff) | |
download | cpython-3fe35e65034de82c45e2d8fe1ebe4a2929c68453.zip cpython-3fe35e65034de82c45e2d8fe1ebe4a2929c68453.tar.gz cpython-3fe35e65034de82c45e2d8fe1ebe4a2929c68453.tar.bz2 |
Issue #18193: Add importlib.reload(), documenting (but not
implementing in code) the deprecation of imp.reload().
Thanks to Berker Peksag for the patch.
Diffstat (limited to 'Lib/test/test_importlib/test_api.py')
-rw-r--r-- | Lib/test/test_importlib/test_api.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/test_api.py b/Lib/test/test_importlib/test_api.py index 297d6cb..330c04e 100644 --- a/Lib/test/test_importlib/test_api.py +++ b/Lib/test/test_importlib/test_api.py @@ -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): |