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