Fred Drake | d74804d | 2001-01-22 19:38:37 +0000 | [diff] [blame] | 1 | """Do a minimal test of all the modules that aren't otherwise tested.""" |
Brett Cannon | 8c5ec0a | 2012-11-14 15:16:53 -0500 | [diff] [blame] | 2 | import importlib |
Paul Monson | 62dfd7d | 2019-04-25 11:36:45 -0700 | [diff] [blame] | 3 | import platform |
Guido van Rossum | cd16bf6 | 2007-06-13 18:07:49 +0000 | [diff] [blame] | 4 | import sys |
Brett Cannon | 8c5ec0a | 2012-11-14 15:16:53 -0500 | [diff] [blame] | 5 | from test import support |
Hai Shi | 598a951 | 2020-08-07 23:18:38 +0800 | [diff] [blame] | 6 | from test.support import import_helper |
| 7 | from test.support import warnings_helper |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 8 | import unittest |
Fred Drake | b112481 | 2001-10-25 18:11:10 +0000 | [diff] [blame] | 9 | |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 10 | class TestUntestedModules(unittest.TestCase): |
Brett Cannon | 8c5ec0a | 2012-11-14 15:16:53 -0500 | [diff] [blame] | 11 | def test_untested_modules_can_be_imported(self): |
Dong-hee Na | be319c0 | 2020-11-25 22:17:30 +0900 | [diff] [blame^] | 12 | untested = ('encodings',) |
Hai Shi | 598a951 | 2020-08-07 23:18:38 +0800 | [diff] [blame] | 13 | with warnings_helper.check_warnings(quiet=True): |
Brett Cannon | 8c5ec0a | 2012-11-14 15:16:53 -0500 | [diff] [blame] | 14 | for name in untested: |
| 15 | try: |
Hai Shi | 598a951 | 2020-08-07 23:18:38 +0800 | [diff] [blame] | 16 | import_helper.import_module('test.test_{}'.format(name)) |
Brett Cannon | 8c5ec0a | 2012-11-14 15:16:53 -0500 | [diff] [blame] | 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)) |
Tim Peters | f87d857 | 2001-01-23 09:50:30 +0000 | [diff] [blame] | 22 | |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 23 | import distutils.bcppcompiler |
| 24 | import distutils.ccompiler |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 25 | import distutils.cygwinccompiler |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 26 | import distutils.filelist |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 27 | import distutils.text_file |
| 28 | import distutils.unixccompiler |
Guido van Rossum | cd16bf6 | 2007-06-13 18:07:49 +0000 | [diff] [blame] | 29 | |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 30 | import distutils.command.bdist_dumb |
Paul Monson | 62dfd7d | 2019-04-25 11:36:45 -0700 | [diff] [blame] | 31 | if sys.platform.startswith('win') and not platform.win32_is_iot(): |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 32 | import distutils.command.bdist_msi |
| 33 | import distutils.command.bdist |
| 34 | import distutils.command.bdist_rpm |
| 35 | import distutils.command.bdist_wininst |
| 36 | import distutils.command.build_clib |
| 37 | import distutils.command.build_ext |
| 38 | import distutils.command.build |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 39 | import distutils.command.clean |
| 40 | import distutils.command.config |
| 41 | import distutils.command.install_data |
| 42 | import distutils.command.install_egg_info |
| 43 | import distutils.command.install_headers |
| 44 | import distutils.command.install_lib |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 45 | import distutils.command.register |
| 46 | import distutils.command.sdist |
| 47 | import distutils.command.upload |
Guido van Rossum | cd16bf6 | 2007-06-13 18:07:49 +0000 | [diff] [blame] | 48 | |
Fred Drake | 3c50ea4 | 2008-05-17 22:02:32 +0000 | [diff] [blame] | 49 | import html.entities |
Senthil Kumaran | a46079e | 2013-10-23 21:55:35 -0700 | [diff] [blame] | 50 | |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 51 | try: |
Brett Cannon | 8c5ec0a | 2012-11-14 15:16:53 -0500 | [diff] [blame] | 52 | import tty # Not available on Windows |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 53 | except ImportError: |
Benjamin Peterson | ee8712c | 2008-05-20 21:35:26 +0000 | [diff] [blame] | 54 | if support.verbose: |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 55 | print("skipping tty") |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 56 | |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 57 | |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 58 | if __name__ == "__main__": |
Brett Cannon | 3e9a9ae | 2013-06-12 21:25:59 -0400 | [diff] [blame] | 59 | unittest.main() |