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

Python code coverage for Lib/test/test_sundry.py

#countcontent
1n/a"""Do a minimal test of all the modules that aren't otherwise tested."""
2n/aimport importlib
3n/aimport sys
4n/afrom test import support
5n/aimport unittest
6n/a
7n/aclass TestUntestedModules(unittest.TestCase):
8n/a def test_untested_modules_can_be_imported(self):
9n/a untested = ('bdb', 'encodings', 'formatter',
10n/a 'nturl2path', 'tabnanny')
11n/a with support.check_warnings(quiet=True):
12n/a for name in untested:
13n/a try:
14n/a support.import_module('test.test_{}'.format(name))
15n/a except unittest.SkipTest:
16n/a importlib.import_module(name)
17n/a else:
18n/a self.fail('{} has tests even though test_sundry claims '
19n/a 'otherwise'.format(name))
20n/a
21n/a import distutils.bcppcompiler
22n/a import distutils.ccompiler
23n/a import distutils.cygwinccompiler
24n/a import distutils.filelist
25n/a import distutils.text_file
26n/a import distutils.unixccompiler
27n/a
28n/a import distutils.command.bdist_dumb
29n/a if sys.platform.startswith('win'):
30n/a import distutils.command.bdist_msi
31n/a import distutils.command.bdist
32n/a import distutils.command.bdist_rpm
33n/a import distutils.command.bdist_wininst
34n/a import distutils.command.build_clib
35n/a import distutils.command.build_ext
36n/a import distutils.command.build
37n/a import distutils.command.clean
38n/a import distutils.command.config
39n/a import distutils.command.install_data
40n/a import distutils.command.install_egg_info
41n/a import distutils.command.install_headers
42n/a import distutils.command.install_lib
43n/a import distutils.command.register
44n/a import distutils.command.sdist
45n/a import distutils.command.upload
46n/a
47n/a import html.entities
48n/a
49n/a try:
50n/a import tty # Not available on Windows
51n/a except ImportError:
52n/a if support.verbose:
53n/a print("skipping tty")
54n/a
55n/a
56n/aif __name__ == "__main__":
57n/a unittest.main()