ยปCore Development>Code coverage>Lib/test/test_tools/__init__.py

Python code coverage for Lib/test/test_tools/__init__.py

#countcontent
1n/a"""Support functions for testing scripts in the Tools directory."""
2n/aimport os
3n/aimport unittest
4n/aimport importlib
5n/afrom test import support
6n/a
7n/abasepath = os.path.dirname( # <src/install dir>
8n/a os.path.dirname( # Lib
9n/a os.path.dirname( # test
10n/a os.path.dirname(__file__)))) # test_tools
11n/a
12n/atoolsdir = os.path.join(basepath, 'Tools')
13n/ascriptsdir = os.path.join(toolsdir, 'scripts')
14n/a
15n/adef skip_if_missing():
16n/a if not os.path.isdir(scriptsdir):
17n/a raise unittest.SkipTest('scripts directory could not be found')
18n/a
19n/adef import_tool(toolname):
20n/a with support.DirsOnSysPath(scriptsdir):
21n/a return importlib.import_module(toolname)
22n/a
23n/adef load_tests(*args):
24n/a return support.load_package_tests(os.path.dirname(__file__), *args)