1"""Do a minimal test of all the modules that aren't otherwise tested.""" 2 3from test import test_support 4import sys 5import unittest 6 7 8class TestUntestedModules(unittest.TestCase): 9 def test_at_least_import_untested_modules(self): 10 with test_support.check_warnings(quiet=True): 11 import CGIHTTPServer 12 import audiodev 13 import bdb 14 import cgitb 15 import code 16 import compileall 17 18 import distutils.bcppcompiler 19 import distutils.ccompiler 20 import distutils.cygwinccompiler 21 import distutils.emxccompiler 22 import distutils.filelist 23 if sys.platform.startswith('win'): 24 import distutils.msvccompiler 25 import distutils.text_file 26 import distutils.unixccompiler 27 28 import distutils.command.bdist_dumb 29 if sys.platform.startswith('win'): 30 try: 31 import distutils.command.bdist_msi # if msi module is not build 32 except ImportError: 33 if test_support.verbose: 34 print "skipping bdist_msi" 35 import distutils.command.bdist 36 import distutils.command.bdist_rpm 37 import distutils.command.bdist_wininst 38 import distutils.command.build_clib 39 import distutils.command.build_ext 40 import distutils.command.build 41 import distutils.command.clean 42 import distutils.command.config 43 import distutils.command.install_data 44 import distutils.command.install_egg_info 45 import distutils.command.install_headers 46 import distutils.command.install_lib 47 import distutils.command.register 48 import distutils.command.sdist 49 import distutils.command.upload 50 51 import encodings 52 import formatter 53 import getpass 54 import htmlentitydefs 55 import ihooks 56 import imghdr 57 import imputil 58 import keyword 59 import linecache 60 import macurl2path 61 import mailcap 62 import mimify 63 import nntplib 64 import nturl2path 65 import opcode 66 import os2emxpath 67 import pdb 68 import posixfile 69 import pstats 70 import py_compile 71 import rexec 72 import sched 73 import sndhdr 74 import statvfs 75 import stringold 76 import sunau 77 import sunaudio 78 import symbol 79 import tabnanny 80 import timeit 81 import toaiff 82 import token 83 try: 84 import tty # not available on Windows 85 except ImportError: 86 if test_support.verbose: 87 print "skipping tty" 88 89 # Can't test the "user" module -- if the user has a ~/.pythonrc.py, it 90 # can screw up all sorts of things (esp. if it prints!). 91 #import user 92 import webbrowser 93 import xml 94 95 96def test_main(): 97 test_support.run_unittest(TestUntestedModules) 98 99if __name__ == "__main__": 100 test_main() 101