| 1 |
"""Do a minimal test of all the modules that aren't otherwise tested.""" |
| 2 |
import importlib |
| 3 |
from test import support |
| 4 |
from test.support import import_helper |
| 5 |
from test.support import warnings_helper |
| 6 |
import unittest |
| 7 |
import sys |
| 8 |
|
| 9 |
class TestUntestedModules(unittest.TestCase): |
| 10 |
def test_untested_modules_can_be_imported(self): |
| 11 |
untested = ('encodings',) |
| 12 |
with warnings_helper.check_warnings(quiet=True): |
| 13 |
for name in untested: |
| 14 |
try: |
| 15 |
import_helper.import_module('test.test_{}'.format(name)) |
| 16 |
except unittest.SkipTest: |
| 17 |
importlib.import_module(name) |
| 18 |
else: |
| 19 |
self.fail('{} has tests even though test_sundry claims ' |
| 20 |
'otherwise'.format(name)) |
| 21 |
|
| 22 |
import html.entities |
| 23 |
|
| 24 |
try: |
| 25 |
import tty |
| 26 |
except ImportError: |
| 27 |
if support.verbose: |
| 28 |
print("skipping tty") |
| 29 |
|
| 30 |
def test_distutils_modules(self): |
| 31 |
with warnings_helper.check_warnings(quiet=True): |
| 32 |
|
| 33 |
path_copy = sys.path[:] |
| 34 |
import distutils |
| 35 |
if '_distutils_hack' in sys.modules: |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
sys.path[:] = path_copy |
| 45 |
raise unittest.SkipTest( |
| 46 |
'setuptools has replaced distutils with its own version') |
| 47 |
|
| 48 |
import distutils.bcppcompiler |
| 49 |
import distutils.ccompiler |
| 50 |
import distutils.cygwinccompiler |
| 51 |
import distutils.filelist |
| 52 |
import distutils.text_file |
| 53 |
import distutils.unixccompiler |
| 54 |
|
| 55 |
import distutils.command.bdist_dumb |
| 56 |
import distutils.command.bdist |
| 57 |
import distutils.command.bdist_rpm |
| 58 |
import distutils.command.build_clib |
| 59 |
import distutils.command.build_ext |
| 60 |
import distutils.command.build |
| 61 |
import distutils.command.clean |
| 62 |
import distutils.command.config |
| 63 |
import distutils.command.install_data |
| 64 |
import distutils.command.install_egg_info |
| 65 |
import distutils.command.install_headers |
| 66 |
import distutils.command.install_lib |
| 67 |
import distutils.command.register |
| 68 |
import distutils.command.sdist |
| 69 |
import distutils.command.upload |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
if __name__ == "__main__": |
| 74 |
unittest.main() |