summaryrefslogtreecommitdiff
path: root/Lib/test/test_importhooks.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_importhooks.py')
-rw-r--r--Lib/test/test_importhooks.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_importhooks.py b/Lib/test/test_importhooks.py
index 7fd8c62a22..f3452fafae 100644
--- a/Lib/test/test_importhooks.py
+++ b/Lib/test/test_importhooks.py
@@ -180,7 +180,7 @@ class ImportHooksTestCase(ImportHooksBaseTestCase):
self.assertFalse(hasattr(reloadmodule,'reloaded'))
TestImporter.modules['reloadmodule'] = (False, reload_co)
- reload(reloadmodule)
+ imp.reload(reloadmodule)
self.assertTrue(hasattr(reloadmodule,'reloaded'))
import hooktestpackage.oldabs
@@ -247,9 +247,11 @@ class ImportHooksTestCase(ImportHooksBaseTestCase):
for n in sys.modules.keys():
if n.startswith(parent):
del sys.modules[n]
- for mname in mnames:
- m = __import__(mname, globals(), locals(), ["__dummy__"])
- m.__loader__ # to make sure we actually handled the import
+ # Silence Py3k warning
+ with test_support.check_warnings():
+ for mname in mnames:
+ m = __import__(mname, globals(), locals(), ["__dummy__"])
+ m.__loader__ # to make sure we actually handled the import
def test_main():