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