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

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

#countcontent
1n/a"""Test suite for packaging.
2n/a
3n/aThis test suite consists of a collection of test modules in the
4n/apackaging.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/aUtility code is included in packaging.tests.support.
9n/a
10n/aAlways import unittest from this module: it will be unittest from the
11n/astandard library for packaging tests and unittest2 for distutils2 tests.
12n/a"""
13n/a
14n/aimport os
15n/aimport sys
16n/aimport unittest
17n/a
18n/a
19n/adef test_suite():
20n/a suite = unittest.TestSuite()
21n/a here = os.path.dirname(__file__) or os.curdir
22n/a for fn in os.listdir(here):
23n/a if fn.startswith("test") and fn.endswith(".py"):
24n/a modname = "packaging.tests." + fn[:-3]
25n/a __import__(modname)
26n/a module = sys.modules[modname]
27n/a suite.addTest(module.test_suite())
28n/a return suite