Commit 5c26eaad authored by Brett Cannon's avatar Brett Cannon

Add support for a --builtin argument to importlib.test to trigger running

import-specific tests with __import__ instead of importlib.
parent 2153dc00
import importlib
from importlib.test.import_ import util
import os.path import os.path
from test.support import run_unittest from test.support import run_unittest
import sys
import unittest import unittest
...@@ -7,6 +10,8 @@ def test_main(): ...@@ -7,6 +10,8 @@ def test_main():
start_dir = os.path.dirname(__file__) start_dir = os.path.dirname(__file__)
top_dir = os.path.dirname(os.path.dirname(start_dir)) top_dir = os.path.dirname(os.path.dirname(start_dir))
test_loader = unittest.TestLoader() 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)) run_unittest(test_loader.discover(start_dir, top_level_dir=top_dir))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment