]> git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/__init__.py
AppPkg/Applications/Python: Add Python 2.7.2 sources since the release of Python...
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / lib2to3 / tests / __init__.py
1 """Make tests/ into a package. This allows us to "import tests" and
2 have tests.all_tests be a TestSuite representing all test cases
3 from all test_*.py files in tests/."""
4 # Author: Collin Winter
5
6 import os
7 import os.path
8 import unittest
9 import types
10
11 from . import support
12
13 all_tests = unittest.TestSuite()
14
15 tests_dir = os.path.join(os.path.dirname(__file__), '..', 'tests')
16 tests = [t[0:-3] for t in os.listdir(tests_dir)
17 if t.startswith('test_') and t.endswith('.py')]
18
19 loader = unittest.TestLoader()
20
21 for t in tests:
22 __import__("",globals(),locals(),[t],level=1)
23 mod = globals()[t]
24 all_tests.addTests(loader.loadTestsFromModule(mod))