ยปCore Development>Code coverage>Lib/unittest/test/__main__.py

Python code coverage for Lib/unittest/test/__main__.py

#countcontent
1n/aimport os
2n/aimport unittest
3n/a
4n/a
5n/adef load_tests(loader, standard_tests, pattern):
6n/a # top level directory cached on loader instance
7n/a this_dir = os.path.dirname(__file__)
8n/a pattern = pattern or "test_*.py"
9n/a # We are inside unittest.test, so the top-level is two notches up
10n/a top_level_dir = os.path.dirname(os.path.dirname(this_dir))
11n/a package_tests = loader.discover(start_dir=this_dir, pattern=pattern,
12n/a top_level_dir=top_level_dir)
13n/a standard_tests.addTests(package_tests)
14n/a return standard_tests
15n/a
16n/a
17n/aif __name__ == '__main__':
18n/a unittest.main()