Back to index

python3.2  3.2.2
Functions
importlib.test.__main__ Namespace Reference

Functions

def test_main

Detailed Description

Run importlib's test suite.

Specifying the ``--builtin`` flag will run tests, where applicable, with
builtins.__import__ instead of importlib.__import__.

Function Documentation

Definition at line 15 of file __main__.py.

00015 
00016 def test_main():
00017     if '__pycache__' in __file__:
00018         parts = __file__.split(os.path.sep)
00019         start_dir = sep.join(parts[:-2])
00020     else:
00021         start_dir = os.path.dirname(__file__)
00022     top_dir = os.path.dirname(os.path.dirname(start_dir))
00023     test_loader = unittest.TestLoader()
00024     if '--builtin' in sys.argv:
00025         util.using___import__ = True
00026     run_unittest(test_loader.discover(start_dir, top_level_dir=top_dir))
00027 

Here is the call graph for this function: