summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_import.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-04-20 19:52:17 (GMT)
committerBrett Cannon <brett@python.org>2012-04-20 19:52:17 (GMT)
commit1032af95ffc6ec1c288504dfd5321e941e3607d4 (patch)
tree0f42f7d938cf85a36ecaaa5f61f6f3d81d6b2904 /Lib/test/test_import.py
parent3dfc22cc048da44c21cb95996522696d8c679fc9 (diff)
downloadcpython-1032af95ffc6ec1c288504dfd5321e941e3607d4.zip
cpython-1032af95ffc6ec1c288504dfd5321e941e3607d4.tar.gz
cpython-1032af95ffc6ec1c288504dfd5321e941e3607d4.tar.bz2
Issue #14585: test_import now runs all tests under
importlib.test.import_ using builtins.__import__() instead of just the relative import tests.
Diffstat (limited to 'Lib/test/test_import.py')
-rw-r--r--Lib/test/test_import.py25
1 files changed, 10 insertions, 15 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index 8510eb8..f02681a 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -1,6 +1,6 @@
import builtins
import imp
-from importlib.test.import_ import test_relative_imports
+from importlib.test.import_ import test_suite as importlib_import_test_suite
from importlib.test.import_ import util as importlib_util
import importlib
import marshal
@@ -694,21 +694,16 @@ class PycacheTests(unittest.TestCase):
self.assertEqual(m.x, 5)
-class RelativeImportFromImportlibTests(test_relative_imports.RelativeImports):
-
- def setUp(self):
- self._importlib_util_flag = importlib_util.using___import__
- importlib_util.using___import__ = True
-
- def tearDown(self):
- importlib_util.using___import__ = self._importlib_util_flag
-
-
def test_main(verbose=None):
- run_unittest(ImportTests, PycacheTests,
- PycRewritingTests, PathsTests, RelativeImportTests,
- OverridingImportBuiltinTests,
- RelativeImportFromImportlibTests)
+ flag = importlib_util.using___import__
+ try:
+ importlib_util.using___import__ = True
+ run_unittest(ImportTests, PycacheTests,
+ PycRewritingTests, PathsTests, RelativeImportTests,
+ OverridingImportBuiltinTests,
+ importlib_import_test_suite())
+ finally:
+ importlib_util.using___import__ = flag
if __name__ == '__main__':