| 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 |
|
| 8 |
class TestUntestedModules(unittest.TestCase): |
| 9 |
def test_untested_modules_can_be_imported(self): |
| 10 |
untested = ('encodings',) |
| 11 |
with warnings_helper.check_warnings(quiet=True): |
| 12 |
for name in untested: |
| 13 |
try: |
| 14 |
import_helper.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 html.entities # noqa: F401 |
| 22 |
|
| 23 |
try: |
| 24 |
# Not available on Windows |
| 25 |
import tty # noqa: F401 |
| 26 |
except ImportError: |
| 27 |
if support.verbose: |
| 28 |
print("skipping tty") |
| 29 |
|
| 30 |
|
| 31 |
if __name__ == "__main__": |
| 32 |
unittest.main() |