diff options
Diffstat (limited to 'Lib/importlib/test/test_api.py')
-rw-r--r-- | Lib/importlib/test/test_api.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/importlib/test/test_api.py b/Lib/importlib/test/test_api.py index 2958adb..8847dc9 100644 --- a/Lib/importlib/test/test_api.py +++ b/Lib/importlib/test/test_api.py @@ -1,6 +1,8 @@ -import unittest -import importlib from . import util +import imp +import importlib +import sys +import unittest class ImportModuleTests(unittest.TestCase): @@ -33,6 +35,7 @@ class ImportModuleTests(unittest.TestCase): relative_name = '.{0}'.format(module_name) with util.mock_modules(pkg_long_name, absolute_name) as mock: with util.import_state(meta_path=[mock]): + importlib.import_module(pkg_name) module = importlib.import_module(relative_name, pkg_name) self.assertEqual(module.__name__, absolute_name) @@ -44,6 +47,7 @@ class ImportModuleTests(unittest.TestCase): name = '{0}.mod'.format(pkg_name) with util.mock_modules(pkg_long_name, name) as mock: with util.import_state(meta_path=[mock]): + importlib.import_module(pkg_name) module = importlib.import_module(name, pkg_name) self.assertEqual(module.__name__, name) |