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

import-specific tests with __import__ instead of importlib.
This commit is contained in:
Brett Cannon 2009-08-27 23:49:56 +00:00
parent 2153dc001f
commit 5c26eaad23
1 changed files with 5 additions and 0 deletions

View File

@ -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))