2009-08-30 05:39:57 -03:00
|
|
|
"""Run importlib's test suite.
|
|
|
|
|
|
|
|
Specifying the ``--builtin`` flag will run tests, where applicable, with
|
|
|
|
builtins.__import__ instead of importlib.__import__.
|
|
|
|
|
|
|
|
"""
|
2009-08-27 20:49:56 -03:00
|
|
|
from importlib.test.import_ import util
|
2009-07-15 01:08:33 -03:00
|
|
|
import os.path
|
|
|
|
from test.support import run_unittest
|
2009-08-27 20:49:56 -03:00
|
|
|
import sys
|
2009-07-15 01:08:33 -03:00
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
|
|
def test_main():
|
2011-06-07 12:58:50 -03:00
|
|
|
start_dir = os.path.dirname(__file__)
|
2009-07-15 01:08:33 -03:00
|
|
|
top_dir = os.path.dirname(os.path.dirname(start_dir))
|
|
|
|
test_loader = unittest.TestLoader()
|
2009-08-27 20:49:56 -03:00
|
|
|
if '--builtin' in sys.argv:
|
|
|
|
util.using___import__ = True
|
2009-07-15 01:08:33 -03:00
|
|
|
run_unittest(test_loader.discover(start_dir, top_level_dir=top_dir))
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
test_main()
|