summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/test
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2009-08-27 23:49:56 (GMT)
committerBrett Cannon <bcannon@gmail.com>2009-08-27 23:49:56 (GMT)
commit5c26eaad23fcfea67384f472013aa61ac445b6b6 (patch)
treef20ce2c39658ef18354996f98b991ddf5c3ce0db /Lib/importlib/test
parent2153dc001f5565592b44808d7f0f25815010eb9d (diff)
downloadcpython-5c26eaad23fcfea67384f472013aa61ac445b6b6.zip
cpython-5c26eaad23fcfea67384f472013aa61ac445b6b6.tar.gz
cpython-5c26eaad23fcfea67384f472013aa61ac445b6b6.tar.bz2
Add support for a --builtin argument to importlib.test to trigger running
import-specific tests with __import__ instead of importlib.
Diffstat (limited to 'Lib/importlib/test')
-rw-r--r--Lib/importlib/test/__main__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/importlib/test/__main__.py b/Lib/importlib/test/__main__.py
index d0710bd..89e1391 100644
--- a/Lib/importlib/test/__main__.py
+++ b/Lib/importlib/test/__main__.py
@@ -1,5 +1,8 @@
+import importlib
+from importlib.test.import_ import util
import os.path
from test.support import run_unittest
+import sys
import unittest
@@ -7,6 +10,8 @@ def test_main():
start_dir = os.path.dirname(__file__)
top_dir = os.path.dirname(os.path.dirname(start_dir))
test_loader = unittest.TestLoader()
+ if '--builtin' in sys.argv:
+ util.using___import__ = True
run_unittest(test_loader.discover(start_dir, top_level_dir=top_dir))