ยปCore Development>Code coverage>Lib/distutils/tests/__init__.py

Python code coverage for Lib/distutils/tests/__init__.py

#countcontent
1n/a"""Test suite for distutils.
2n/a
3n/aThis test suite consists of a collection of test modules in the
4n/adistutils.tests package. Each test module has a name starting with
5n/a'test' and contains a function test_suite(). The function is expected
6n/ato return an initialized unittest.TestSuite instance.
7n/a
8n/aTests for the command classes in the distutils.command package are
9n/aincluded in distutils.tests as well, instead of using a separate
10n/adistutils.command.tests package, since command identification is done
11n/aby import rather than matching pre-defined names.
12n/a
13n/a"""
14n/a
15n/aimport os
16n/aimport sys
17n/aimport unittest
18n/afrom test.support import run_unittest
19n/a
20n/a
21n/ahere = os.path.dirname(__file__) or os.curdir
22n/a
23n/a
24n/adef test_suite():
25n/a suite = unittest.TestSuite()
26n/a for fn in os.listdir(here):
27n/a if fn.startswith("test") and fn.endswith(".py"):
28n/a modname = "distutils.tests." + fn[:-3]
29n/a __import__(modname)
30n/a module = sys.modules[modname]
31n/a suite.addTest(module.test_suite())
32n/a return suite
33n/a
34n/a
35n/aif __name__ == "__main__":
36n/a run_unittest(test_suite())