diff options
author | Brett Cannon <brett@python.org> | 2012-11-14 20:16:53 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-11-14 20:16:53 (GMT) |
commit | 8c5ec0a3af75a6779dad4101d0a9ad421f64fa60 (patch) | |
tree | 5467958f0a272e34de29701fe2e3da7646031247 /Lib/test/test_sundry.py | |
parent | 613cf25d2af6640b82ce56cb3e270fdaa027e6ad (diff) | |
download | cpython-8c5ec0a3af75a6779dad4101d0a9ad421f64fa60.zip cpython-8c5ec0a3af75a6779dad4101d0a9ad421f64fa60.tar.gz cpython-8c5ec0a3af75a6779dad4101d0a9ad421f64fa60.tar.bz2 |
Clean up test_sundry and have it error out when a module has grown
proper tests.
Diffstat (limited to 'Lib/test/test_sundry.py')
-rw-r--r-- | Lib/test/test_sundry.py | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/Lib/test/test_sundry.py b/Lib/test/test_sundry.py index ea1325a..a364194 100644 --- a/Lib/test/test_sundry.py +++ b/Lib/test/test_sundry.py @@ -1,14 +1,22 @@ """Do a minimal test of all the modules that aren't otherwise tested.""" - -from test import support +import importlib import sys +from test import support import unittest class TestUntestedModules(unittest.TestCase): - def test_at_least_import_untested_modules(self): + def test_untested_modules_can_be_imported(self): + untested = ('bdb', 'encodings', 'formatter', 'getpass', 'imghdr', + 'keyword', 'macurl2path', 'nturl2path', 'tabnanny') with support.check_warnings(quiet=True): - import bdb - import cgitb + for name in untested: + try: + support.import_module('test.test_{}'.format(name)) + except unittest.SkipTest: + importlib.import_module(name) + else: + self.fail('{} has tests even though test_sundry claims ' + 'otherwise'.format(name)) import distutils.bcppcompiler import distutils.ccompiler @@ -38,21 +46,9 @@ class TestUntestedModules(unittest.TestCase): import distutils.command.sdist import distutils.command.upload - import encodings - import formatter - import getpass import html.entities - import imghdr - import keyword - import macurl2path - import mailcap - import nturl2path - import pstats - import py_compile - import sndhdr - import tabnanny try: - import tty # not available on Windows + import tty # Not available on Windows except ImportError: if support.verbose: print("skipping tty") |