]> granicus.if.org Git - python/commitdiff
#2621 rename test.test_support to test.support
authorBenjamin Peterson <benjamin@python.org>
Tue, 20 May 2008 21:35:26 +0000 (21:35 +0000)
committerBenjamin Peterson <benjamin@python.org>
Tue, 20 May 2008 21:35:26 +0000 (21:35 +0000)
358 files changed:
Doc/library/test.rst
Lib/bsddb/test/test_associate.py
Lib/bsddb/test/test_basics.py
Lib/bsddb/test/test_compare.py
Lib/bsddb/test/test_cursor_pget_bug.py
Lib/bsddb/test/test_dbobj.py
Lib/bsddb/test/test_dbshelve.py
Lib/bsddb/test/test_dbtables.py
Lib/bsddb/test/test_env_close.py
Lib/bsddb/test/test_join.py
Lib/bsddb/test/test_lock.py
Lib/bsddb/test/test_misc.py
Lib/bsddb/test/test_pickle.py
Lib/bsddb/test/test_recno.py
Lib/bsddb/test/test_sequence.py
Lib/bsddb/test/test_thread.py
Lib/distutils/tests/test_core.py
Lib/distutils/tests/test_dist.py
Lib/distutils/tests/test_sysconfig.py
Lib/email/test/test_email.py
Lib/email/test/test_email_codecs.py
Lib/email/test/test_email_codecs_renamed.py
Lib/email/test/test_email_torture.py
Lib/test/double_const.py
Lib/test/list_tests.py
Lib/test/outstanding_bugs.py
Lib/test/pickletester.py
Lib/test/regrtest.py
Lib/test/string_tests.py
Lib/test/support.py [moved from Lib/test/test_support.py with 99% similarity]
Lib/test/test_SimpleHTTPServer.py
Lib/test/test___all__.py
Lib/test/test___future__.py
Lib/test/test__locale.py
Lib/test/test_abc.py
Lib/test/test_abstract_numbers.py
Lib/test/test_anydbm.py
Lib/test/test_array.py
Lib/test/test_ast.py
Lib/test/test_asynchat.py
Lib/test/test_asyncore.py
Lib/test/test_atexit.py
Lib/test/test_audioop.py
Lib/test/test_augassign.py
Lib/test/test_base64.py
Lib/test/test_bigaddrspace.py
Lib/test/test_bigmem.py
Lib/test/test_binascii.py
Lib/test/test_binhex.py
Lib/test/test_binop.py
Lib/test/test_bisect.py
Lib/test/test_bool.py
Lib/test/test_bsddb.py
Lib/test/test_bsddb3.py
Lib/test/test_bufio.py
Lib/test/test_builtin.py
Lib/test/test_bytes.py
Lib/test/test_bz2.py
Lib/test/test_cProfile.py
Lib/test/test_calendar.py
Lib/test/test_call.py
Lib/test/test_capi.py
Lib/test/test_cfgparser.py
Lib/test/test_cgi.py
Lib/test/test_charmapcodec.py
Lib/test/test_class.py
Lib/test/test_cmath.py
Lib/test/test_cmd.py
Lib/test/test_cmd_line.py
Lib/test/test_cmd_line_script.py
Lib/test/test_code.py
Lib/test/test_codeccallbacks.py
Lib/test/test_codecencodings_cn.py
Lib/test/test_codecencodings_hk.py
Lib/test/test_codecencodings_jp.py
Lib/test/test_codecencodings_kr.py
Lib/test/test_codecencodings_tw.py
Lib/test/test_codecmaps_cn.py
Lib/test/test_codecmaps_hk.py
Lib/test/test_codecmaps_jp.py
Lib/test/test_codecmaps_kr.py
Lib/test/test_codecmaps_tw.py
Lib/test/test_codecs.py
Lib/test/test_codeop.py
Lib/test/test_coding.py
Lib/test/test_collections.py
Lib/test/test_colorsys.py
Lib/test/test_commands.py
Lib/test/test_compare.py
Lib/test/test_compile.py
Lib/test/test_complex.py
Lib/test/test_contains.py
Lib/test/test_contextlib.py
Lib/test/test_cookie.py
Lib/test/test_cookielib.py
Lib/test/test_copy.py
Lib/test/test_copyreg.py
Lib/test/test_crypt.py
Lib/test/test_csv.py
Lib/test/test_ctypes.py
Lib/test/test_curses.py
Lib/test/test_datetime.py
Lib/test/test_dbm.py
Lib/test/test_decimal.py
Lib/test/test_decorators.py
Lib/test/test_defaultdict.py
Lib/test/test_deque.py
Lib/test/test_descr.py
Lib/test/test_descrtut.py
Lib/test/test_dict.py
Lib/test/test_dictcomps.py
Lib/test/test_dictviews.py
Lib/test/test_difflib.py
Lib/test/test_dis.py
Lib/test/test_distutils.py
Lib/test/test_doctest.py
Lib/test/test_doctest2.py
Lib/test/test_docxmlrpc.py
Lib/test/test_dumbdbm.py
Lib/test/test_dummy_thread.py
Lib/test/test_dummy_threading.py
Lib/test/test_email.py
Lib/test/test_enumerate.py
Lib/test/test_eof.py
Lib/test/test_epoll.py
Lib/test/test_errno.py
Lib/test/test_exception_variations.py
Lib/test/test_exceptions.py
Lib/test/test_extcall.py
Lib/test/test_fcntl.py
Lib/test/test_file.py
Lib/test/test_filecmp.py
Lib/test/test_fileinput.py
Lib/test/test_fileio.py
Lib/test/test_float.py
Lib/test/test_fnmatch.py
Lib/test/test_fork1.py
Lib/test/test_format.py
Lib/test/test_fractions.py
Lib/test/test_frozen.py
Lib/test/test_ftplib.py
Lib/test/test_funcattrs.py
Lib/test/test_functools.py
Lib/test/test_future.py
Lib/test/test_future3.py
Lib/test/test_future4.py
Lib/test/test_gc.py
Lib/test/test_gdbm.py
Lib/test/test_generators.py
Lib/test/test_genericpath.py
Lib/test/test_genexps.py
Lib/test/test_getargs2.py
Lib/test/test_getopt.py
Lib/test/test_gettext.py
Lib/test/test_glob.py
Lib/test/test_global.py
Lib/test/test_grammar.py
Lib/test/test_grp.py
Lib/test/test_gzip.py
Lib/test/test_hash.py
Lib/test/test_hashlib.py
Lib/test/test_heapq.py
Lib/test/test_hmac.py
Lib/test/test_htmllib.py
Lib/test/test_htmlparser.py
Lib/test/test_httplib.py
Lib/test/test_imaplib.py
Lib/test/test_imp.py
Lib/test/test_import.py
Lib/test/test_importhooks.py
Lib/test/test_index.py
Lib/test/test_inspect.py
Lib/test/test_int.py
Lib/test/test_int_literal.py
Lib/test/test_io.py
Lib/test/test_ioctl.py
Lib/test/test_isinstance.py
Lib/test/test_iter.py
Lib/test/test_iterlen.py
Lib/test/test_itertools.py
Lib/test/test_json.py
Lib/test/test_keywordonlyarg.py
Lib/test/test_kqueue.py
Lib/test/test_largefile.py
Lib/test/test_lib2to3.py
Lib/test/test_list.py
Lib/test/test_listcomps.py
Lib/test/test_locale.py
Lib/test/test_logging.py
Lib/test/test_long.py
Lib/test/test_long_future.py
Lib/test/test_longexp.py
Lib/test/test_macpath.py
Lib/test/test_mailbox.py
Lib/test/test_marshal.py
Lib/test/test_math.py
Lib/test/test_memoryio.py
Lib/test/test_memoryview.py
Lib/test/test_metaclass.py
Lib/test/test_mimetools.py
Lib/test/test_mimetypes.py
Lib/test/test_minidom.py
Lib/test/test_mmap.py
Lib/test/test_module.py
Lib/test/test_modulefinder.py
Lib/test/test_multibytecodec.py
Lib/test/test_multibytecodec_support.py
Lib/test/test_mutants.py
Lib/test/test_netrc.py
Lib/test/test_nis.py
Lib/test/test_normalization.py
Lib/test/test_ntpath.py
Lib/test/test_opcodes.py
Lib/test/test_openpty.py
Lib/test/test_operator.py
Lib/test/test_optparse.py
Lib/test/test_os.py
Lib/test/test_ossaudiodev.py
Lib/test/test_parser.py
Lib/test/test_peepholer.py
Lib/test/test_pep247.py
Lib/test/test_pep263.py
Lib/test/test_pep277.py
Lib/test/test_pep292.py
Lib/test/test_pep3120.py
Lib/test/test_pep3131.py
Lib/test/test_pep352.py
Lib/test/test_pickle.py
Lib/test/test_pickletools.py
Lib/test/test_pipes.py
Lib/test/test_pkg.py
Lib/test/test_pkgimport.py
Lib/test/test_pkgutil.py
Lib/test/test_platform.py
Lib/test/test_plistlib.py
Lib/test/test_poll.py
Lib/test/test_popen.py
Lib/test/test_poplib.py
Lib/test/test_posix.py
Lib/test/test_posixpath.py
Lib/test/test_pow.py
Lib/test/test_pprint.py
Lib/test/test_print.py
Lib/test/test_profile.py
Lib/test/test_profilehooks.py
Lib/test/test_property.py
Lib/test/test_pstats.py
Lib/test/test_pty.py
Lib/test/test_pwd.py
Lib/test/test_pyclbr.py
Lib/test/test_pydoc.py
Lib/test/test_pyexpat.py
Lib/test/test_queue.py
Lib/test/test_quopri.py
Lib/test/test_raise.py
Lib/test/test_random.py
Lib/test/test_range.py
Lib/test/test_re.py
Lib/test/test_reprlib.py
Lib/test/test_resource.py
Lib/test/test_rfc822.py
Lib/test/test_richcmp.py
Lib/test/test_robotparser.py
Lib/test/test_runpy.py
Lib/test/test_sax.py
Lib/test/test_scope.py
Lib/test/test_select.py
Lib/test/test_set.py
Lib/test/test_setcomps.py
Lib/test/test_sgmllib.py
Lib/test/test_shelve.py
Lib/test/test_shlex.py
Lib/test/test_shutil.py
Lib/test/test_signal.py
Lib/test/test_site.py
Lib/test/test_slice.py
Lib/test/test_smtplib.py
Lib/test/test_socket.py
Lib/test/test_socketserver.py
Lib/test/test_sort.py
Lib/test/test_sqlite.py
Lib/test/test_ssl.py
Lib/test/test_startfile.py
Lib/test/test_strftime.py
Lib/test/test_string.py
Lib/test/test_stringprep.py
Lib/test/test_strptime.py
Lib/test/test_struct.py
Lib/test/test_structmembers.py
Lib/test/test_structseq.py
Lib/test/test_subprocess.py
Lib/test/test_sundry.py
Lib/test/test_super.py
Lib/test/test_symtable.py
Lib/test/test_syntax.py
Lib/test/test_sys.py
Lib/test/test_syslog.py
Lib/test/test_tarfile.py
Lib/test/test_tcl.py
Lib/test/test_telnetlib.py
Lib/test/test_tempfile.py
Lib/test/test_textwrap.py
Lib/test/test_thread.py
Lib/test/test_threaded_import.py
Lib/test/test_threadedtempfile.py
Lib/test/test_threading.py
Lib/test/test_threading_local.py
Lib/test/test_threadsignals.py
Lib/test/test_time.py
Lib/test/test_timeout.py
Lib/test/test_tokenize.py
Lib/test/test_trace.py
Lib/test/test_traceback.py
Lib/test/test_tuple.py
Lib/test/test_typechecks.py
Lib/test/test_types.py
Lib/test/test_ucn.py
Lib/test/test_unary.py
Lib/test/test_unicode.py
Lib/test/test_unicode_file.py
Lib/test/test_unicodedata.py
Lib/test/test_unittest.py
Lib/test/test_univnewlines.py
Lib/test/test_unpack.py
Lib/test/test_unpack_ex.py
Lib/test/test_urllib.py
Lib/test/test_urllib2.py
Lib/test/test_urllib2_localnet.py
Lib/test/test_urllib2net.py
Lib/test/test_urllibnet.py
Lib/test/test_urlparse.py
Lib/test/test_userdict.py
Lib/test/test_userlist.py
Lib/test/test_userstring.py
Lib/test/test_uu.py
Lib/test/test_uuid.py
Lib/test/test_wait3.py
Lib/test/test_wait4.py
Lib/test/test_warnings.py
Lib/test/test_wave.py
Lib/test/test_weakref.py
Lib/test/test_weakset.py
Lib/test/test_whichdb.py
Lib/test/test_winreg.py
Lib/test/test_winsound.py
Lib/test/test_with.py
Lib/test/test_wsgiref.py
Lib/test/test_xdrlib.py
Lib/test/test_xml_etree.py
Lib/test/test_xml_etree_c.py
Lib/test/test_xmlrpc.py
Lib/test/test_xmlrpc_net.py
Lib/test/test_zipfile.py
Lib/test/test_zipfile64.py
Lib/test/test_zipimport.py
Lib/test/test_zlib.py
Lib/test/xmltests.py
Misc/NEWS

index a6a3584823360ab8c581da034f97638f0ee156c2..4c0af39ece32afed3eeb544832d2cacaf481bb85 100644 (file)
@@ -179,14 +179,14 @@ at the top-level directory where Python was built. On Windows, executing
 tests.
 
 
-:mod:`test.test_support` --- Utility functions for tests
+:mod:`test.support` --- Utility functions for tests
 ========================================================
 
-.. module:: test.test_support
+.. module:: test.support
    :synopsis: Support for Python regression tests.
 
 
-The :mod:`test.test_support` module provides support for Python's regression
+The :mod:`test.support` module provides support for Python's regression
 tests.
 
 This module defines the following exceptions:
@@ -236,7 +236,7 @@ The :mod:`test.test_support` module defines the following constants:
    Set to the path that a temporary file may be created at. Any temporary that is
    created should be closed and unlinked (removed).
 
-The :mod:`test.test_support` module defines the following functions:
+The :mod:`test.support` module defines the following functions:
 
 
 .. function:: forget(module_name)
@@ -311,7 +311,7 @@ The :mod:`test.test_support` module defines the following functions:
       assert s.getvalue() == "hello"
 
 
-The :mod:`test.test_support` module defines the following classes:
+The :mod:`test.support` module defines the following classes:
 
 .. class:: TransientResource(exc[, **kwargs])
 
index 1c80a88293b21d8d7b9b4f2e3df09211869b6bd6..b9f250bbd76d1f29b235273df3d782b5ceae4cac 100644 (file)
@@ -27,7 +27,7 @@ except ImportError:
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 
 #----------------------------------------------------------------------
index 6b99cc1fdfbd323c540dedfd7ec20c5f45be86ff..9c829bd915d2a8bc637f94ba51a01c9bf67144fd 100644 (file)
@@ -23,7 +23,7 @@ from bsddb.test.test_all import verbose
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 DASH = b'-'
 letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
index 2c9706a0d9fa13c5a542aa0678312cfa06a7c319..e2562fbef883d221ec7c1e17d36857a8281ef172 100644 (file)
@@ -19,7 +19,7 @@ except ImportError:
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 lexical_cmp = cmp
 
index 887a69e9e0231aef31df471dd3984bc483f4b0ee..a06428ca3eba28190768cc04a07dab4719c7bb8c 100644 (file)
@@ -9,7 +9,7 @@ from bsddb import db
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 
 #----------------------------------------------------------------------
index f67af4098111cbf7a6e8daa83b76976f566a14a5..5f3170d021618c961638192289ac18cb8b15d348 100644 (file)
@@ -14,7 +14,7 @@ except ImportError:
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 
 #----------------------------------------------------------------------
index a597154f58c14e6e375d38755ea3dfe26091c49f..95f7ad16813f38e735f40ec648a270bce28b44f8 100644 (file)
@@ -12,7 +12,7 @@ from bsddb import db, dbshelve
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 from bsddb.test.test_all import verbose
 
index f1328f0c8cd3d74064cb83c150faef4334d2197c..061a731954edf1f7c76bbfb0034b98cfa66d867e 100644 (file)
@@ -37,7 +37,7 @@ except ImportError:
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 
 #----------------------------------------------------------------------
index 9f7c85324a5822df0d49a94e51dd96f60df90a2f..48096856b0b889be4df88514db556f9230bdddfb 100644 (file)
@@ -18,7 +18,7 @@ except ImportError:
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 from bsddb.test.test_all import verbose
 
index 311835a85fd76db56c1aa6125ac90b38edca4a17..de674eeb7a61a0c8344e74aa5be8afd1e4941566 100644 (file)
@@ -21,7 +21,7 @@ from bsddb import db, dbshelve, StringKeys
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 #----------------------------------------------------------------------
 
index 1259d03e74c47b09ef7909d4b5fd97a8dbb212e2..5baba6912891e0ef6dc88ae11601610ab7552933 100644 (file)
@@ -26,7 +26,7 @@ except ImportError:
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 
 #----------------------------------------------------------------------
index 0d812888eb9146ed95e8fd8a3bbbdaeb6f5365e1..03c08f427ee2d0bd96686946a0d403f622543388 100644 (file)
@@ -17,7 +17,7 @@ except ImportError:
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 #----------------------------------------------------------------------
 
index f4c34ab3a775010abf33b5d0c5874156fe710203..c1175e633207a0304c342f96212fbb95c18b6515 100644 (file)
@@ -16,7 +16,7 @@ except ImportError as e:
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 
 #----------------------------------------------------------------------
index 6855d18a3d26439e8e1b73f57d5ada8bd783aaf9..3bc2f2d9671fcaea0245c99ab9e404d672791138 100644 (file)
@@ -21,7 +21,7 @@ except ImportError:
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
 
index 90be5f68f9172eb131acdc5bab28c3b1819d3803..2e9c99303c42123cc8a3145f9545cbeea1399c41 100644 (file)
@@ -14,7 +14,7 @@ from bsddb.test.test_all import verbose
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 
 class DBSequenceTest(unittest.TestCase):
index 51ed0f52fb0b4439cfa44d0eb29a97dca72818ec..e39124eaf62ab4a4728585d59524acf440d77d05 100644 (file)
@@ -36,7 +36,7 @@ except ImportError:
 try:
     from bsddb3 import test_support
 except ImportError:
-    from test import test_support
+    from test import support as test_support
 
 
 #----------------------------------------------------------------------
index 8e274dd40da105c92fede9cc6b1deabdff45de6a..170d76751e7e97aececd421d65651d86961fbbb3 100644 (file)
@@ -5,7 +5,7 @@ import distutils.core
 import os
 import shutil
 import sys
-import test.test_support
+import test.support
 import unittest
 
 
@@ -39,13 +39,13 @@ class CoreTestCase(unittest.TestCase):
         self.cleanup_testfn()
 
     def cleanup_testfn(self):
-        path = test.test_support.TESTFN
+        path = test.support.TESTFN
         if os.path.isfile(path):
             os.remove(path)
         elif os.path.isdir(path):
             shutil.rmtree(path)
 
-    def write_setup(self, text, path=test.test_support.TESTFN):
+    def write_setup(self, text, path=test.support.TESTFN):
         open(path, "w").write(text)
         return path
 
@@ -63,8 +63,8 @@ class CoreTestCase(unittest.TestCase):
         cwd = os.getcwd()
 
         # Create a directory and write the setup.py file there:
-        os.mkdir(test.test_support.TESTFN)
-        setup_py = os.path.join(test.test_support.TESTFN, "setup.py")
+        os.mkdir(test.support.TESTFN)
+        setup_py = os.path.join(test.support.TESTFN, "setup.py")
         distutils.core.run_setup(
             self.write_setup(setup_prints_cwd, path=setup_py))
 
index dd0773508e20800600dc3b6d180d54bacfb7b488..f1b11c17454a950b199afc729699ccfae2e43806 100644 (file)
@@ -7,7 +7,7 @@ import io
 import sys
 import unittest
 
-from test.test_support import TESTFN
+from test.support import TESTFN
 
 
 class test_dist(distutils.cmd.Command):
index aa1187e77bc432fb5c06c4cca30234cf94ce25ca..c6ab9aa5d59e8f4b6c63a8ab457777ec03d8b446 100644 (file)
@@ -4,7 +4,7 @@ from distutils import sysconfig
 import os
 import unittest
 
-from test.test_support import TESTFN
+from test.support import TESTFN
 
 class SysconfigTestCase(unittest.TestCase):
 
index 1ca41e9f39165dee98d492905050aba302ee2a1b..9639d30a2678315861d6aaa4b9ea23d0dbe5877a 100644 (file)
@@ -34,7 +34,7 @@ from email import iterators
 from email import base64mime
 from email import quoprimime
 
-from test.test_support import findfile, run_unittest
+from test.support import findfile, run_unittest
 from email.test import __file__ as landmark
 
 
index 1c773473bbf33c1ff65820fc02d91eae77e3d43e..a7bcb892fa7b7fd1766b37a1800eb992a768e499 100644 (file)
@@ -3,7 +3,7 @@
 # email package unit tests for (optional) Asian codecs
 
 import unittest
-from test.test_support import TestSkipped, run_unittest
+from test.support import TestSkipped, run_unittest
 
 from email.test.test_email import TestEmailBase
 from email.Charset import Charset
index d190de313b5360afc4e43043b351feb388f34c2a..712221224523037952ce8d49ae2e046b15904746 100644 (file)
@@ -3,7 +3,7 @@
 # email package unit tests for (optional) Asian codecs
 
 import unittest
-from test.test_support import TestSkipped, run_unittest
+from test.support import TestSkipped, run_unittest
 
 from email.test.test_email import TestEmailBase
 from email.charset import Charset
index 67f106acf38dc959a015019f5f13d0bbeebce233..57233bfdbb043badbd0aa51c97ced8c4128d0acc 100644 (file)
@@ -13,7 +13,7 @@ from io import StringIO
 from types import ListType
 
 from email.test.test_email import TestEmailBase
-from test.test_support import TestSkipped
+from test.support import TestSkipped
 
 import email
 from email import __file__ as testfile
@@ -128,7 +128,7 @@ def suite():
 
 def test_main():
     for testclass in _testclasses():
-        test_support.run_unittest(testclass)
+        support.run_unittest(testclass)
 
 
 \f
index 16c33a19c9883b112250322f3cb828c5a6613f9f..67852aaf982280e59bc82c27023d55ad9f912983 100644 (file)
@@ -1,4 +1,4 @@
-from test.test_support import TestFailed
+from test.support import TestFailed
 
 # A test for SF bug 422177:  manifest float constants varied way too much in
 # precision depending on whether Python was loading a module for the first
index 4ffa6684e6535384c4e268843b47168d529ac426..6250908ba5616a9c91262485ff39ddb041a1dbaa 100644 (file)
@@ -5,7 +5,7 @@ Tests common to list and UserList.UserList
 import sys
 import os
 
-from test import test_support, seq_tests
+from test import support, seq_tests
 
 def CmpToKey(mycmp):
     'Convert a cmp= function into a key= function'
@@ -66,14 +66,14 @@ class CommonTest(seq_tests.CommonTest):
         d.append(d)
         d.append(400)
         try:
-            fo = open(test_support.TESTFN, "w")
+            fo = open(support.TESTFN, "w")
             fo.write(str(d))
             fo.close()
-            fo = open(test_support.TESTFN, "r")
+            fo = open(support.TESTFN, "r")
             self.assertEqual(fo.read(), repr(d))
         finally:
             fo.close()
-            os.remove(test_support.TESTFN)
+            os.remove(support.TESTFN)
 
     def test_set_subscript(self):
         a = self.type2test(range(20))
index 3f672fb9d14afe55d016325a5ebecbdb6e348ebc..9e4784ce16eecf1085988a5c598beeacead85b27 100644 (file)
@@ -7,7 +7,7 @@
 #
 
 import unittest
-from test import test_support
+from test import support
 
 #
 # One test case for outstanding bugs at the moment:
@@ -22,7 +22,7 @@ class TextIOWrapperTest(unittest.TestCase):
         self.normalized = b"AAA\nBBB\nCCC\nDDD\nEEE\n".decode("ASCII")
 
     def tearDown(self):
-        test_support.unlink(test_support.TESTFN)
+        support.unlink(support.TESTFN)
 
 
     def test_issue1395_1(self):
@@ -81,7 +81,7 @@ class TextIOWrapperTest(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         TextIOWrapperTest)
 
 if __name__ == "__main__":
index 666b9c269dce839893671e072cd650b01f422855..783d3612fcbcb49f6b29b2ac440104685b88b1cf 100644 (file)
@@ -3,7 +3,7 @@ import pickle
 import pickletools
 import copyreg
 
-from test.test_support import TestFailed, TESTFN, run_with_locale
+from test.support import TestFailed, TESTFN, run_with_locale
 
 from pickle import bytes_types
 
index f87b8a8f860572eb5e910aebc96846996e651a2e..41772c662daef6b95655ed0bf0ee0968adf1133c 100755 (executable)
@@ -171,7 +171,7 @@ if sys.platform == 'darwin':
         newsoft = min(hard, max(soft, 1024*2048))
         resource.setrlimit(resource.RLIMIT_STACK, (newsoft, hard))
 
-from test import test_support
+from test import support
 
 RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network', 'bsddb',
                   'decimal', 'compiler', 'subprocess', 'urlfetch')
@@ -209,7 +209,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
     values that would normally be set by flags on the command line.
     """
 
-    test_support.record_original_stdout(sys.stdout)
+    support.record_original_stdout(sys.stdout)
     try:
         opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsSrf:lu:t:TD:NLR:wM:n',
                                    ['help', 'verbose', 'quiet', 'exclude',
@@ -284,7 +284,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
             # stringobject.c filling slowly with random data
             warm_char_cache()
         elif o in ('-M', '--memlimit'):
-            test_support.set_memlimit(a)
+            support.set_memlimit(a)
         elif o in ('-u', '--use'):
             u = [x.lower() for x in a.split(',')]
             for r in u:
@@ -390,8 +390,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
         tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix],
                              trace=False, count=True)
     test_times = []
-    test_support.verbose = verbose      # Tell tests to be moderately quiet
-    test_support.use_resources = use_resources
+    support.verbose = verbose      # Tell tests to be moderately quiet
+    support.use_resources = use_resources
     save_modules = sys.modules.keys()
     for test in tests:
         if not quiet:
@@ -433,7 +433,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
         # Unload the newly imported modules (best effort finalization)
         for module in sys.modules.keys():
             if module not in save_modules and module.startswith("test."):
-                test_support.unload(module)
+                support.unload(module)
 
     # The lists won't be sorted if running with -r
     good.sort()
@@ -479,7 +479,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
             print("Re-running test %r in verbose mode" % test)
             sys.stdout.flush()
             try:
-                test_support.verbose = True
+                support.verbose = True
                 ok = runtest(test, generate, True, quiet, test_times, testdir,
                              huntrleaks, debug)
             except KeyboardInterrupt:
@@ -526,7 +526,6 @@ STDTESTS = [
 ]
 
 NOTTESTS = {
-    'test_support',
     'test_future1',
     'test_future2',
 }
@@ -572,7 +571,7 @@ def runtest(test, generate, verbose, quiet, test_times,
 
 def runtest_inner(test, generate, verbose, quiet, test_times,
                   testdir=None, huntrleaks=False, debug=False):
-    test_support.unload(test)
+    support.unload(test)
     if not testdir:
         testdir = findtestdir()
     if verbose:
@@ -606,19 +605,19 @@ def runtest_inner(test, generate, verbose, quiet, test_times,
             test_times.append((test_time, test))
         finally:
             sys.stdout = save_stdout
-    except test_support.ResourceDenied as msg:
+    except support.ResourceDenied as msg:
         if not quiet:
             print(test, "skipped --", msg)
             sys.stdout.flush()
         return -2
-    except (ImportError, test_support.TestSkipped) as msg:
+    except (ImportError, support.TestSkipped) as msg:
         if not quiet:
             print(test, "skipped --", msg)
             sys.stdout.flush()
         return -1
     except KeyboardInterrupt:
         raise
-    except test_support.TestFailed as msg:
+    except support.TestFailed as msg:
         print("test", test, "failed --", msg)
         sys.stdout.flush()
         return 0
@@ -652,7 +651,7 @@ def cleanup_test_droppings(testname, verbose):
     # since if a test leaves a file open, it cannot be deleted by name (while
     # there's nothing we can do about that here either, we can display the
     # name of the offending test, which is a real help).
-    for name in (test_support.TESTFN,
+    for name in (support.TESTFN,
                  "db_home",
                 ):
         if not os.path.exists(name):
@@ -1206,10 +1205,10 @@ class _ExpectedSkips:
 if __name__ == '__main__':
     # Remove regrtest.py's own directory from the module search path.  This
     # prevents relative imports from working, and relative imports will screw
-    # up the testing framework.  E.g. if both test.test_support and
-    # test_support are imported, they will not contain the same globals, and
+    # up the testing framework.  E.g. if both test.support and
+    # support are imported, they will not contain the same globals, and
     # much of the testing framework relies on the globals in the
-    # test.test_support module.
+    # test.support module.
     mydir = os.path.abspath(os.path.normpath(os.path.dirname(sys.argv[0])))
     i = pathlen = len(sys.path)
     while i >= 0:
index caafb31388837a7fd90fb44c7eee396397ef4262..60308d740068f108c5b19c7759bfe6c347ae8a98 100644 (file)
@@ -3,7 +3,7 @@ Common tests shared by test_str, test_unicode, test_userstring and test_string.
 """
 
 import unittest, string, sys, struct
-from test import test_support
+from test import support
 from collections import UserList
 
 class Sequence:
similarity index 99%
rename from Lib/test/test_support.py
rename to Lib/test/support.py
index c4084bb3c6eca85d20a65215978e8f8b358d6962..b8bc406011675aa04d30e4a69b4c91b0e5a842f8 100644 (file)
@@ -1,7 +1,7 @@
 """Supporting definitions for the Python regression tests."""
 
-if __name__ != 'test.test_support':
-    raise ImportError('test_support must be imported from the test package')
+if __name__ != 'test.support':
+    raise ImportError('support must be imported from the test package')
 
 import contextlib
 import errno
@@ -700,7 +700,7 @@ def run_doctest(module, verbosity=None):
     """Run doctest on the given module.  Return (#failures, #tests).
 
     If optional argument verbosity is not specified (or is None), pass
-    test_support's belief about verbosity on to doctest.  Else doctest's
+    support's belief about verbosity on to doctest.  Else doctest's
     usual behavior is used (it searches sys.argv for -v).
     """
 
index 9d3ad16be628f085a2727c8a086f1b8e8d3d1403..d285f274f1d72c8b34aac6f782dfcbacd44702f9 100644 (file)
@@ -5,7 +5,7 @@ We don't want to require the 'network' resource.
 
 import os, unittest
 from SimpleHTTPServer import SimpleHTTPRequestHandler
-from test import test_support
+from test import support
 
 
 class SocketlessRequestHandler (SimpleHTTPRequestHandler):
@@ -35,7 +35,7 @@ class SimpleHTTPRequestHandlerTestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(SimpleHTTPRequestHandlerTestCase)
+    support.run_unittest(SimpleHTTPRequestHandlerTestCase)
 
 if __name__ == "__main__":
     test_main()
index 9d0487d8f5552e8535c8b7f35ca441962d429bed..c58aeadacef9330b627d676da88511b519e70284 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test.test_support import run_unittest, catch_warning
+from test.support import run_unittest, catch_warning
 import sys
 import warnings
 
index 95041554990bdae24b562326d5fc6af5bc77f1a3..77006e1abcfabb3a96232c483d2c5072b12fcfc3 100644 (file)
@@ -1,6 +1,6 @@
 #! /usr/bin/env python
 import unittest
-from test import test_support
+from test import support
 import __future__
 
 GOOD_SERIALS = ("alpha", "beta", "candidate", "final")
@@ -57,7 +57,7 @@ class FutureTest(unittest.TestCase):
                    ".compiler_flag isn't int")
 
 def test_main():
-    test_support.run_unittest(FutureTest)
+    support.run_unittest(FutureTest)
 
 if __name__ == "__main__":
     test_main()
index aed273d1e63405db71bc25b87c93ce78427edc49..9dec027d21fa2ea640804c48c0ffec184b0f7a92 100644 (file)
@@ -1,4 +1,4 @@
-from test.test_support import verbose, TestSkipped, run_unittest
+from test.support import verbose, TestSkipped, run_unittest
 from _locale import (setlocale, LC_ALL, LC_CTYPE, LC_NUMERIC, RADIXCHAR, THOUSEP, nl_langinfo,
                     localeconv, Error)
 import unittest
index d631c3ebf5061ecea99e4a070e538d7800772f2c..a4cefc532804b9d00a71f4d96cf2693e928cdc85 100644 (file)
@@ -4,7 +4,7 @@
 """Unit tests for abc.py."""
 
 import unittest
-from test import test_support
+from test import support
 
 import abc
 from inspect import isabstract
@@ -170,7 +170,7 @@ class TestABC(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(TestABC)
+    support.run_unittest(TestABC)
 
 
 if __name__ == "__main__":
index 244f87ab0f26d30654d0418ed2ffbf24dbc3393f..e20f2d42c0faeeee3991555004d008d7494650fa 100644 (file)
@@ -5,7 +5,7 @@ import operator
 import unittest
 from numbers import Complex, Real, Rational, Integral
 from numbers import Number
-from test import test_support
+from test import support
 
 class TestNumbers(unittest.TestCase):
     def test_int(self):
@@ -40,7 +40,7 @@ class TestNumbers(unittest.TestCase):
         self.assertRaises(TypeError, int, c1)
 
 def test_main():
-    test_support.run_unittest(TestNumbers)
+    support.run_unittest(TestNumbers)
 
 
 if __name__ == "__main__":
index 9399d711cffcb6a0b49e1ddc547eb8f6e9012fee..ace9dd207cc7d7cc756b50aba131eebfd12e43f0 100644 (file)
@@ -7,9 +7,9 @@ import os
 import unittest
 import anydbm
 import glob
-from test import test_support
+from test import support
 
-_fname = test_support.TESTFN
+_fname = support.TESTFN
 
 _all_modules = []
 
@@ -121,7 +121,7 @@ class AnyDBMTestCase(unittest.TestCase):
 def test_main():
     try:
         for module in dbm_iterator():
-            test_support.run_unittest(AnyDBMTestCase)
+            support.run_unittest(AnyDBMTestCase)
     finally:
         delete_files()
 
index 70fac6668de8dab98420d8acf943b7d93c370cde..66ce2ad23ecf4153b856f927fd67e745da14763e 100755 (executable)
@@ -4,7 +4,7 @@
 """
 
 import unittest
-from test import test_support
+from test import support
 from weakref import proxy
 import array, io, math
 from pickle import loads, dumps
@@ -162,13 +162,13 @@ class BaseTest(unittest.TestCase):
     def test_tofromfile(self):
         a = array.array(self.typecode, 2*self.example)
         self.assertRaises(TypeError, a.tofile)
-        test_support.unlink(test_support.TESTFN)
-        f = open(test_support.TESTFN, 'wb')
+        support.unlink(support.TESTFN)
+        f = open(support.TESTFN, 'wb')
         try:
             a.tofile(f)
             f.close()
             b = array.array(self.typecode)
-            f = open(test_support.TESTFN, 'rb')
+            f = open(support.TESTFN, 'rb')
             self.assertRaises(TypeError, b.fromfile)
             b.fromfile(f, len(self.example))
             self.assertEqual(b, array.array(self.typecode, self.example))
@@ -180,7 +180,7 @@ class BaseTest(unittest.TestCase):
         finally:
             if not f.closed:
                 f.close()
-            test_support.unlink(test_support.TESTFN)
+            support.unlink(support.TESTFN)
 
     def test_tofromlist(self):
         a = array.array(self.typecode, 2*self.example)
@@ -967,14 +967,14 @@ tests.append(DoubleTest)
 def test_main(verbose=None):
     import sys
 
-    test_support.run_unittest(*tests)
+    support.run_unittest(*tests)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_unittest(*tests)
+            support.run_unittest(*tests)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
index f4fbc94f5a2d1af7d355be5b72bb77e8d7d97e51..4c74cf7dbf4f1de58a71153379488daf7fa9639b 100644 (file)
@@ -1,5 +1,5 @@
 import sys, unittest
-from test import test_support
+from test import support
 import _ast
 
 def to_tuple(t):
@@ -176,7 +176,7 @@ class AST_Tests(unittest.TestCase):
                     self.assertEquals(to_tuple(ast2), to_tuple(ast))
 
 def test_main():
-    test_support.run_unittest(AST_Tests)
+    support.run_unittest(AST_Tests)
 
 def main():
     if __name__ != '__main__':
index d24e8cc326b8869c600756a69043f633cda499ab..4d49f581de69f278f84087952704310506766e4a 100644 (file)
@@ -4,9 +4,9 @@ import thread # If this fails, we can't test this module
 import asyncore, asynchat, socket, threading, time
 import unittest
 import sys
-from test import test_support
+from test import support
 
-HOST = test_support.HOST
+HOST = support.HOST
 SERVER_QUIT = b'QUIT\n'
 
 class echo_server(threading.Thread):
@@ -18,7 +18,7 @@ class echo_server(threading.Thread):
         threading.Thread.__init__(self)
         self.event = event
         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-        self.port = test_support.bind_port(self.sock)
+        self.port = support.bind_port(self.sock)
 
     def run(self):
         self.sock.listen(1)
@@ -248,7 +248,7 @@ class TestFifo(unittest.TestCase):
 
 
 def test_main(verbose=None):
-    test_support.run_unittest(TestAsynchat, TestAsynchat_WithPoll,
+    support.run_unittest(TestAsynchat, TestAsynchat_WithPoll,
                               TestHelperFunctions, TestFifo)
 
 if __name__ == "__main__":
index 09401bd8394e402b8691c299d9ff00fe4aeca7fc..eb52687866d3763b40c30623526c392f0720b7fe 100644 (file)
@@ -7,12 +7,12 @@ import threading
 import sys
 import time
 
-from test import test_support
-from test.test_support import TESTFN, run_unittest, unlink
+from test import support
+from test.support import TESTFN, run_unittest, unlink
 from io import BytesIO
 from io import StringIO
 
-HOST = test_support.HOST
+HOST = support.HOST
 
 class dummysocket:
     def __init__(self):
@@ -334,7 +334,7 @@ class DispatcherWithSendTests(unittest.TestCase):
         self.evt = threading.Event()
         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         self.sock.settimeout(3)
-        self.port = test_support.bind_port(self.sock)
+        self.port = support.bind_port(self.sock)
 
         cap = BytesIO()
         args = (self.evt, cap, self.sock)
index 76a50362ca044a7b2c618762ab3e39fc951c8044..6856042edc60a1040b9e7f29b53d9691fe79e65e 100644 (file)
@@ -2,7 +2,7 @@ import sys
 import unittest
 import io
 import atexit
-from test import test_support
+from test import support
 
 ### helpers
 def h1():
@@ -109,7 +109,7 @@ class TestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(TestCase)
+    support.run_unittest(TestCase)
 
 if __name__ == "__main__":
     test_main()
index ab8be02d8bdb242e17b0ce3ab5ea11bbe2679049..ae796ba57421cefe75840a115a030e8c4e7ccf8c 100644 (file)
@@ -1,6 +1,6 @@
 # Test audioop.
 import audioop
-from test.test_support import verbose
+from test.support import verbose
 
 def gendata1():
     return b'\0\1\2'
index 0309d6e0b1a496f1db7e96a25171ae6786d60118..e03b4d4e5cebfbe8a0399177cd4591505f0c3761 100644 (file)
@@ -1,6 +1,6 @@
 # Augmented assignment test.
 
-from test.test_support import run_unittest
+from test.support import run_unittest
 import unittest
 
 
index c50652cac50e51cde382b526be5d7c7ef5af9e4d..e899016f786d4b67430cd0b51b7210a81facc85f 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 import base64
 import binascii
 
@@ -209,7 +209,7 @@ class BaseXYTestCase(unittest.TestCase):
 
 \f
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == '__main__':
     test_main()
index 8c215fe09ad6ba5b157a0dd3751f651b695bc794..3aedc4cf35666a7cb7226f9dc66800afce0bdf75 100644 (file)
@@ -1,5 +1,5 @@
-from test import test_support
-from test.test_support import bigaddrspacetest, MAX_Py_ssize_t
+from test import support
+from test.support import bigaddrspacetest, MAX_Py_ssize_t
 
 import unittest
 import operator
@@ -38,9 +38,9 @@ class StrTest(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(StrTest)
+    support.run_unittest(StrTest)
 
 if __name__ == '__main__':
     if len(sys.argv) > 1:
-        test_support.set_memlimit(sys.argv[1])
+        support.set_memlimit(sys.argv[1])
     test_main()
index 27e1ecf5f22a5a7b8b07184dd4d9d40eeff74c50..30e1bdb18cbcb8f88089750f6bcadc89ca22ee01 100644 (file)
@@ -1,5 +1,5 @@
-from test import test_support
-from test.test_support import bigmemtest, _1G, _2G
+from test import support
+from test.support import bigmemtest, _1G, _2G
 
 import unittest
 import operator
@@ -957,9 +957,9 @@ class ListTest(unittest.TestCase):
         self.assertEquals(l[-10:], [5] * 10)
 
 def test_main():
-    test_support.run_unittest(StrTest, TupleTest, ListTest)
+    support.run_unittest(StrTest, TupleTest, ListTest)
 
 if __name__ == '__main__':
     if len(sys.argv) > 1:
-        test_support.set_memlimit(sys.argv[1])
+        support.set_memlimit(sys.argv[1])
     test_main()
index fb9a666378ad593603956fab932b654bddf4cd3a..76a76b247f076facb7730043d029467c1bb81712 100755 (executable)
@@ -1,6 +1,6 @@
 """Test the binascii C module."""
 
-from test import test_support
+from test import support
 import unittest
 import binascii
 
@@ -169,7 +169,7 @@ class BinASCIITest(unittest.TestCase):
         binascii.crc_hqx('', 0)
 
 def test_main():
-    test_support.run_unittest(BinASCIITest)
+    support.run_unittest(BinASCIITest)
 
 if __name__ == "__main__":
     test_main()
index 61c24c9d11f179cc31b6acbef2bcc4ddfcc668a4..06fd98aa64a26e1205d07c489dd25df14273aae6 100755 (executable)
@@ -7,18 +7,18 @@
 import binhex
 import os
 import unittest
-from test import test_support
+from test import support
 
 
 class BinHexTestCase(unittest.TestCase):
 
     def setUp(self):
-        self.fname1 = test_support.TESTFN + "1"
-        self.fname2 = test_support.TESTFN + "2"
+        self.fname1 = support.TESTFN + "1"
+        self.fname2 = support.TESTFN + "2"
 
     def tearDown(self):
-        test_support.unlink(self.fname1)
-        test_support.unlink(self.fname2)
+        support.unlink(self.fname1)
+        support.unlink(self.fname2)
 
     DATA = b'Jack is my hero'
 
@@ -39,7 +39,7 @@ class BinHexTestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(BinHexTestCase)
+    support.run_unittest(BinHexTestCase)
 
 
 if __name__ == "__main__":
index f0433fbd7efaa4784f47abf787a4f15b814f2fc3..b260b1bf61421fc3dff8051f72af11bfa6df3f1a 100644 (file)
@@ -1,7 +1,7 @@
 """Tests for binary operators on subtypes of built-in types."""
 
 import unittest
-from test import test_support
+from test import support
 
 def gcd(a, b):
     """Greatest common divisor using Euclid's algorithm."""
@@ -317,7 +317,7 @@ self.assertEqual(eval('1/2'), 0.5)
 """
 
 def test_main():
-    test_support.run_unittest(RatTestCase)
+    support.run_unittest(RatTestCase)
 
 
 if __name__ == "__main__":
index 11495bad8a3ea70d2c300bb8cd5918e466ff51f6..af9f1f7c6413241c230f55a77b2656afe379497c 100644 (file)
@@ -1,6 +1,6 @@
 import sys
 import unittest
-from test import test_support
+from test import support
 from collections import UserList
 
 # We do a bit of trickery here to be able to test both the C implementation
@@ -286,15 +286,15 @@ def test_main(verbose=None):
                     TestInsortPython, TestInsortC,
                     TestErrorHandlingPython, TestErrorHandlingC]
 
-    test_support.run_unittest(*test_classes)
-    test_support.run_doctest(test_bisect, verbose)
+    support.run_unittest(*test_classes)
+    support.run_doctest(test_bisect, verbose)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_unittest(*test_classes)
+            support.run_unittest(*test_classes)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
index bbaea85c63cb7a4509bf22ac08d4b58e2a052154..591b0eb3964186c91e74c979ae2578659278d5b9 100644 (file)
@@ -1,7 +1,7 @@
 # Test properties of bool promised by PEP 285
 
 import unittest
-from test import test_support
+from test import support
 
 import os
 
@@ -26,14 +26,14 @@ class BoolTest(unittest.TestCase):
 
     def test_print(self):
         try:
-            fo = open(test_support.TESTFN, "w")
+            fo = open(support.TESTFN, "w")
             print(False, True, file=fo)
             fo.close()
-            fo = open(test_support.TESTFN, "r")
+            fo = open(support.TESTFN, "r")
             self.assertEqual(fo.read(), 'False True\n')
         finally:
             fo.close()
-            os.remove(test_support.TESTFN)
+            os.remove(support.TESTFN)
 
     def test_repr(self):
         self.assertEqual(repr(False), 'False')
@@ -234,12 +234,12 @@ class BoolTest(unittest.TestCase):
 
     def test_fileclosed(self):
         try:
-            f = open(test_support.TESTFN, "w")
+            f = open(support.TESTFN, "w")
             self.assertIs(f.closed, False)
             f.close()
             self.assertIs(f.closed, True)
         finally:
-            os.remove(test_support.TESTFN)
+            os.remove(support.TESTFN)
 
     def test_operator(self):
         import operator
@@ -331,7 +331,7 @@ class BoolTest(unittest.TestCase):
                     self.assertEqual(str(e_bool), str(e_len))
 
 def test_main():
-    test_support.run_unittest(BoolTest)
+    support.run_unittest(BoolTest)
 
 if __name__ == "__main__":
     test_main()
index dfee3dcb11436e1d3b94fca782b9c2bd6180093d..3eb291f3a902ba0542300542dc7a267323e9c982 100755 (executable)
@@ -7,7 +7,7 @@ import copy
 import bsddb
 import dbhash # Just so we know it's imported
 import unittest
-from test import test_support
+from test import support
 
 class TestBSDDB(unittest.TestCase):
     openflag = 'c'
@@ -274,7 +274,7 @@ class TestBSDDB(unittest.TestCase):
         self.assertEqual(list(self.f), keys)
 
 class TestBTree(TestBSDDB):
-    fname = test_support.TESTFN
+    fname = support.TESTFN
     openmethod = [bsddb.btopen]
 
 class TestBTree_InMemory(TestBSDDB):
@@ -287,7 +287,7 @@ class TestBTree_InMemory_Truncate(TestBSDDB):
     openmethod = [bsddb.btopen]
 
 class TestHashTable(TestBSDDB):
-    fname = test_support.TESTFN
+    fname = support.TESTFN
     openmethod = [bsddb.hashopen]
 
 class TestHashTable_InMemory(TestBSDDB):
@@ -299,7 +299,7 @@ class TestHashTable_InMemory(TestBSDDB):
 ##         #                                   Solaris Intel - rmasse 1/97
 
 def test_main(verbose=None):
-    test_support.run_unittest(
+    support.run_unittest(
         TestBTree,
         TestHashTable,
         TestBTree_InMemory,
index 1f58c121c7d8a93f6a59a8cae994e6fa41d3123f..6a277d979805dab589a32f59b2f2669d19d25fae 100644 (file)
@@ -7,7 +7,7 @@ import sys
 import tempfile
 import time
 import unittest
-from test.test_support import requires, verbose, run_unittest, unlink, rmtree
+from test.support import requires, verbose, run_unittest, unlink, rmtree
 
 # When running as a script instead of within the regrtest framework, skip the
 # requires test, since it's obvious we want to run them.
index 804a401a25077bd3a94f37e8a98416bcf3cdd539..e65951d77c01257006b9c6a1fecd6673f1ad5e40 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 
 # Simple test to ensure that optimizations in fileobject.c deliver
 # the expected results.  For best testing, run this under a debug-build
@@ -14,18 +14,18 @@ class BufferSizeTest(unittest.TestCase):
         # .readline()s deliver what we wrote.
 
         # Ensure we can open TESTFN for writing.
-        test_support.unlink(test_support.TESTFN)
+        support.unlink(support.TESTFN)
 
         # Since C doesn't guarantee we can write/read arbitrary bytes in text
         # files, use binary mode.
-        f = open(test_support.TESTFN, "wb")
+        f = open(support.TESTFN, "wb")
         try:
             # write once with \n and once without
             f.write(s)
             f.write(b"\n")
             f.write(s)
             f.close()
-            f = open(test_support.TESTFN, "rb")
+            f = open(support.TESTFN, "rb")
             line = f.readline()
             self.assertEqual(line, s + b"\n")
             line = f.readline()
@@ -34,7 +34,7 @@ class BufferSizeTest(unittest.TestCase):
             self.assert_(not line) # Must be at EOF
             f.close()
         finally:
-            test_support.unlink(test_support.TESTFN)
+            support.unlink(support.TESTFN)
 
     def drive_one(self, pattern):
         for length in lengths:
@@ -59,7 +59,7 @@ class BufferSizeTest(unittest.TestCase):
         self.drive_one(bytes(1000))
 
 def test_main():
-    test_support.run_unittest(BufferSizeTest)
+    support.run_unittest(BufferSizeTest)
 
 if __name__ == "__main__":
     test_main()
index a74cc84be44aa291db254276cc98230fb85c749c..ef562db54c28e747fb83ca0b408403aa4853509d 100644 (file)
@@ -1,7 +1,7 @@
 # Python test set -- built-in functions
 
-import test.test_support, unittest
-from test.test_support import fcmp, TESTFN, unlink,  run_unittest, \
+import test.support, unittest
+from test.support import fcmp, TESTFN, unlink,  run_unittest, \
                               run_with_locale
 from operator import neg
 
index 5f3580d23b451597ed43738365972014fbfc5212..206dde935b6ecacc50b255520c02d4a565bc4f0f 100644 (file)
@@ -13,7 +13,7 @@ import pickle
 import tempfile
 import unittest
 import warnings
-import test.test_support
+import test.support
 import test.string_tests
 import test.buffer_tests
 
@@ -969,13 +969,13 @@ class ByteArraySubclassTest(unittest.TestCase):
 
 
 def test_main():
-    test.test_support.run_unittest(BytesTest)
-    test.test_support.run_unittest(ByteArrayTest)
-    test.test_support.run_unittest(AssortedBytesTest)
-    test.test_support.run_unittest(BytesAsStringTest)
-    test.test_support.run_unittest(ByteArrayAsStringTest)
-    test.test_support.run_unittest(ByteArraySubclassTest)
-    test.test_support.run_unittest(BytearrayPEP3137Test)
+    test.support.run_unittest(BytesTest)
+    test.support.run_unittest(ByteArrayTest)
+    test.support.run_unittest(AssortedBytesTest)
+    test.support.run_unittest(BytesAsStringTest)
+    test.support.run_unittest(ByteArrayAsStringTest)
+    test.support.run_unittest(ByteArraySubclassTest)
+    test.support.run_unittest(BytearrayPEP3137Test)
 
 if __name__ == "__main__":
     test_main()
index 39bf19c329f673b173d0bab580a9975c4c905c4f..4646f02ac1655e8c5268f5b09373eb6b00a02407 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/python
-from test import test_support
-from test.test_support import TESTFN
+from test import support
+from test.support import TESTFN
 
 import unittest
 from io import BytesIO
@@ -333,13 +333,13 @@ class FuncTest(BaseTest):
         self.assertRaises(ValueError, bz2.decompress, self.DATA[:-10])
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         BZ2FileTest,
         BZ2CompressorTest,
         BZ2DecompressorTest,
         FuncTest
     )
-    test_support.reap_children()
+    support.reap_children()
 
 if __name__ == '__main__':
     test_main()
index 7ae0bca678f9da87491320348a25acb3f1b28974..913ed1adeea6843c0c191467891b311d1c74cf77 100644 (file)
@@ -121,7 +121,7 @@ class C:
 
 
 def test_main():
-    from test.test_support import TestSkipped
+    from test.support import TestSkipped
     raise TestSkipped('test_cProfile test is current broken')
 
 
index 5f9c0571bae981240edb19c484f2b5edbe89c3d6..5debee9b88f408a7bb7a5ac69950b7b40e7be6b4 100644 (file)
@@ -1,7 +1,7 @@
 import calendar
 import unittest
 
-from test import test_support
+from test import support
 
 
 result_2004_text = """
@@ -383,7 +383,7 @@ class SundayTestCase(MonthCalendarTestCase):
 
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         OutputTestCase,
         CalendarTestCase,
         MondayTestCase,
index 2652343ee13a8c132abc0961a8bd41ee12ab7bf8..c00ccbac85b2fda8c9e49183c1584569d203e34c 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 
 # The test cases here cover several paths through the function calling
 # code.  They depend on the METH_XXX flag that is used to define a C
@@ -124,7 +124,7 @@ class CFunctionCalls(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(CFunctionCalls)
+    support.run_unittest(CFunctionCalls)
 
 
 if __name__ == "__main__":
index 87be9ee7755f3533249b389ddcd4709fc153555c..df5ce0b65849f0370900069b97660ea3c68befa2 100644 (file)
@@ -2,7 +2,7 @@
 # these are all functions _testcapi exports whose name begins with 'test_'.
 
 import sys
-from test import test_support
+from test import support
 import _testcapi
 
 def test_main():
@@ -10,13 +10,13 @@ def test_main():
     for name in dir(_testcapi):
         if name.startswith('test_'):
             test = getattr(_testcapi, name)
-            if test_support.verbose:
+            if support.verbose:
                 print("internal", name)
             test()
 
     # some extra thread-state tests driven via _testcapi
     def TestThreadState():
-        if test_support.verbose:
+        if support.verbose:
             print("auto-thread-state")
 
         idents = []
@@ -29,7 +29,7 @@ def test_main():
         time.sleep(1)
         # Check our main thread is in the list exactly 3 times.
         if idents.count(thread.get_ident()) != 3:
-            raise test_support.TestFailed(
+            raise support.TestFailed(
                         "Couldn't find main thread correctly in the list")
 
     try:
index 70bf0acf63ea36445054e3e93c43693aec593b46..dcc1a9807f0e625afb8ccd9c33d8d8c1c94cd67c 100644 (file)
@@ -3,7 +3,7 @@ import io
 import unittest
 import collections
 
-from test import test_support
+from test import support
 
 class SortedDict(collections.UserDict):
     def items(self):
@@ -251,7 +251,7 @@ class TestCaseBase(unittest.TestCase):
         cf.set("sect", "option2", "splat")
 
     def test_read_returns_file_list(self):
-        file1 = test_support.findfile("cfgparser.1")
+        file1 = support.findfile("cfgparser.1")
         # check when we pass a mix of readable and non-readable files:
         cf = self.newconfig()
         parsed_files = cf.read([file1, "nonexistant-file"])
@@ -469,7 +469,7 @@ class SortedTestCase(RawConfigParserTestCase):
                           "o4 = 1\n\n")
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         ConfigParserTestCase,
         RawConfigParserTestCase,
         SafeConfigParserTestCase,
index f28719bd99ce4f654e563c7ea2c5f675b2e2f843..f9b336f7e50eb2dbe8d34cacb46a6c5ae0ec6115 100644 (file)
@@ -1,4 +1,4 @@
-from test.test_support import run_unittest
+from test.support import run_unittest
 import cgi
 import os
 import sys
index 5e4055eec9474d18f6c48527e98c197a1f62ceae..8b79bdef827b2cb1d8da0bf3fb97a19ee9003061 100644 (file)
@@ -9,7 +9,7 @@ Written by Marc-Andre Lemburg (mal@lemburg.com).
 
 """#"
 
-import test.test_support, unittest
+import test.support, unittest
 
 import codecs
 
@@ -50,7 +50,7 @@ class CharmapCodecTest(unittest.TestCase):
         self.assertRaises(UnicodeError, str, b'abc\001', codecname)
 
 def test_main():
-    test.test_support.run_unittest(CharmapCodecTest)
+    test.support.run_unittest(CharmapCodecTest)
 
 if __name__ == "__main__":
     test_main()
index 730826db8652fb41811ecaa53939281048e3f09f..cabf715dcbdcf9c86c7864bc9ad1ba8e5da0389c 100644 (file)
@@ -2,7 +2,7 @@
 
 import unittest
 
-from test import test_support
+from test import support
 
 testmeths = [
 
@@ -555,7 +555,7 @@ class ClassTests(unittest.TestCase):
         hash(a.f)
 
 def test_main():
-    test_support.run_unittest(ClassTests)
+    support.run_unittest(ClassTests)
 
 if __name__=='__main__':
     test_main()
index ca4945d18c23c3dda01b9a3a72dac1c7aeab8b71..3c34fecd90492b58d764e65bb7c3db23f4ae3e76 100755 (executable)
@@ -1,4 +1,4 @@
-from test.test_support import run_unittest
+from test.support import run_unittest
 from test.test_math import parse_testfile, test_file
 import unittest
 import os, sys
index 2c77931071c66588a86a4eb40e772739b223443b..e2b3022a2a5884ed5bf8478f65ed809c1daa35fb 100644 (file)
@@ -167,8 +167,8 @@ class samplecmdclass(cmd.Cmd):
         return True
 
 def test_main(verbose=None):
-    from test import test_support, test_cmd
-    test_support.run_doctest(test_cmd, verbose)
+    from test import support, test_cmd
+    support.run_doctest(test_cmd, verbose)
 
 def test_coverage(coverdir):
     tracer=trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,],
index 19089a44aa6d5a9ffe35227e1d1a6c6d7ac5232d..9ccf3f5041a467c344fdc90dd32bed7297c3cd8d 100644 (file)
@@ -2,7 +2,7 @@
 # All tests are executed with environment variables ignored
 # See test_cmd_line_script.py for testing of script execution
 
-import test.test_support, unittest
+import test.support, unittest
 import sys
 import subprocess
 
@@ -123,8 +123,8 @@ class CmdLineTest(unittest.TestCase):
 
 
 def test_main():
-    test.test_support.run_unittest(CmdLineTest)
-    test.test_support.reap_children()
+    test.support.run_unittest(CmdLineTest)
+    test.support.reap_children()
 
 if __name__ == "__main__":
     test_main()
index 74031c9be1fb96084bfae865f406429be3694c23..e0b09ea8ee53e6fc1a64fc06432b43e5940128f5 100644 (file)
@@ -4,7 +4,7 @@ import unittest
 import os
 import os.path
 import sys
-import test.test_support
+import test.support
 import tempfile
 import subprocess
 import py_compile
@@ -12,9 +12,9 @@ import contextlib
 import shutil
 import zipfile
 
-verbose = test.test_support.verbose
+verbose = test.support.verbose
 
-# XXX ncoghlan: Should we consider moving these to test_support?
+# XXX ncoghlan: Should we consider moving these to support?
 from test.test_cmd_line import _spawn_python, _kill_python
 
 def _run_python(*args):
@@ -176,8 +176,8 @@ class CmdLineTest(unittest.TestCase):
 
 
 def test_main():
-    test.test_support.run_unittest(CmdLineTest)
-    test.test_support.reap_children()
+    test.support.run_unittest(CmdLineTest)
+    test.support.reap_children()
 
 if __name__ == '__main__':
     test_main()
index 63378c22ed1f6bf05803b562dd37dd336e6e1522..c8fa2a138bc3e2f1d51866ef6564c63b68adee2d 100644 (file)
@@ -119,7 +119,7 @@ def dump(co):
     print("consts:", tuple(consts(co.co_consts)))
 
 def test_main(verbose=None):
-    from test.test_support import run_doctest
+    from test.support import run_doctest
     from test import test_code
     run_doctest(test_code, verbose)
 
index 64d1645dbb2dffdc13012fe3405dcd7aa19fee18..d1a48688f867e638602e18efe04d5c8bc4d4494f 100644 (file)
@@ -1,4 +1,4 @@
-import test.test_support, unittest
+import test.support, unittest
 import sys, codecs, html.entities, unicodedata
 
 class PosReturn:
@@ -843,7 +843,7 @@ class CodecCallbackTest(unittest.TestCase):
             self.assertRaises(TypeError, data.decode, encoding, "test.replacing")
 
 def test_main():
-    test.test_support.run_unittest(CodecCallbackTest)
+    test.support.run_unittest(CodecCallbackTest)
 
 if __name__ == "__main__":
     test_main()
index bc1d7add15989baff352c390d6f4f1dccae4d363..77bac139cff17a5365153d0b6866d2ab8bf391ef 100644 (file)
@@ -4,7 +4,7 @@
 #   Codec encoding tests for PRC encodings.
 #
 
-from test import test_support
+from test import support
 from test import test_multibytecodec_support
 import unittest
 
@@ -51,7 +51,7 @@ class Test_GB18030(test_multibytecodec_support.TestBase, unittest.TestCase):
     has_iso10646 = True
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index c8e794114a6be2b974f1912d28ee55a57cc30da3..b1deb715a5330129ef33e2fb78676d80d118a0f9 100644 (file)
@@ -4,7 +4,7 @@
 #   Codec encoding tests for HongKong encodings.
 #
 
-from test import test_support
+from test import support
 from test import test_multibytecodec_support
 import unittest
 
@@ -21,7 +21,7 @@ class Test_Big5HKSCS(test_multibytecodec_support.TestBase, unittest.TestCase):
     )
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index 5d939a64cbef23eb2036a774b2f304eb27a517c4..e2cd7d70208854f3fed7ce29370d527e4036ccc7 100644 (file)
@@ -4,7 +4,7 @@
 #   Codec encoding tests for Japanese encodings.
 #
 
-from test import test_support
+from test import support
 from test import test_multibytecodec_support
 import unittest
 
@@ -99,7 +99,7 @@ class Test_SJISX0213(test_multibytecodec_support.TestBase, unittest.TestCase):
     )
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index 18ed3934c344d0ae839d06a0fba21840e44b8526..34fade923e26200cc1d48cb596c317c3e199f79b 100644 (file)
@@ -4,7 +4,7 @@
 #   Codec encoding tests for ROK encodings.
 #
 
-from test import test_support
+from test import support
 from test import test_multibytecodec_support
 import unittest
 
@@ -63,7 +63,7 @@ class Test_JOHAB(test_multibytecodec_support.TestBase, unittest.TestCase):
     )
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index bb7fd3822e5cd5ce42198266a8c0568d3afd2375..6b840d36cef817fb852fc8c37c9c59af69030a8d 100644 (file)
@@ -4,7 +4,7 @@
 #   Codec encoding tests for ROC encodings.
 #
 
-from test import test_support
+from test import support
 from test import test_multibytecodec_support
 import unittest
 
@@ -21,7 +21,7 @@ class Test_Big5(test_multibytecodec_support.TestBase, unittest.TestCase):
     )
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index 344fc562f715254feca0419a416b402ba27ec9e6..34a910d8768e1c39fe207243cadffe607b0914ce 100644 (file)
@@ -4,7 +4,7 @@
 #   Codec mapping tests for PRC encodings
 #
 
-from test import test_support
+from test import support
 from test import test_multibytecodec_support
 import unittest
 
@@ -27,7 +27,7 @@ class TestGB18030Map(test_multibytecodec_support.TestBase_Mapping,
 
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index 362ab7fafcbfe8d516597a67d8968cec586967fc..ddb1208b3d2d4c01eccfa0c3319c8598a1a41ca7 100644 (file)
@@ -4,7 +4,7 @@
 #   Codec mapping tests for HongKong encodings
 #
 
-from test import test_support
+from test import support
 from test import test_multibytecodec_support
 import unittest
 
@@ -14,8 +14,8 @@ class TestBig5HKSCSMap(test_multibytecodec_support.TestBase_Mapping,
     mapfileurl = 'http://people.freebsd.org/~perky/i18n/BIG5HKSCS-2004.TXT'
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
-    test_support.use_resources = ['urlfetch']
+    support.use_resources = ['urlfetch']
     test_main()
index dec97fb75f9e6774859a83a357a9630226d37a70..75db00c6027eef3bc3250461e6344b8bbdeccfb8 100644 (file)
@@ -4,7 +4,7 @@
 #   Codec mapping tests for Japanese encodings
 #
 
-from test import test_support
+from test import support
 from test import test_multibytecodec_support
 import unittest
 
@@ -61,7 +61,7 @@ class TestSJISX0213Map(test_multibytecodec_support.TestBase_Mapping,
 
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index f9c97e5b490c640662ba31020718d1b2248f14c7..0da9d1ce955192d2f0b497ba4638117dc94b39cb 100644 (file)
@@ -4,7 +4,7 @@
 #   Codec mapping tests for ROK encodings
 #
 
-from test import test_support
+from test import support
 from test import test_multibytecodec_support
 import unittest
 
@@ -38,7 +38,7 @@ class TestJOHABMap(test_multibytecodec_support.TestBase_Mapping,
     pass_dectest = [(b'\\', '\u20a9')]
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index 4bd196629827354d84933d4505cecb7f07b944fe..e6df3a72fc391212aea4fad1bf980dcc34feda7a 100644 (file)
@@ -4,7 +4,7 @@
 #   Codec mapping tests for ROC encodings
 #
 
-from test import test_support
+from test import support
 from test import test_multibytecodec_support
 import unittest
 
@@ -25,7 +25,7 @@ class TestCP950Map(test_multibytecodec_support.TestBase_Mapping,
     ]
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index a828edfa6ef07dd5cff022ddb9efa61f29b8251a..a7da809ccb0510456724e5dae047970dd2b6dd91 100644 (file)
@@ -1,4 +1,4 @@
-from test import test_support
+from test import support
 import unittest
 import codecs
 import sys, _testcapi, io
@@ -1032,7 +1032,7 @@ class NameprepTest(unittest.TestCase):
                 try:
                     self.assertEquals(nameprep(orig), prepped)
                 except Exception as e:
-                    raise test_support.TestFailed("Test 3.%d: %s" % (pos+1, str(e)))
+                    raise support.TestFailed("Test 3.%d: %s" % (pos+1, str(e)))
 
 class IDNACodecTest(unittest.TestCase):
     def test_builtin_decode(self):
@@ -1477,7 +1477,7 @@ class WithStmtTest(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         UTF32Test,
         UTF32LETest,
         UTF32BETest,
index edea6011175413e2baf059450136dfbc56950dfa..224a314195970624c6a60fa8d22df9d1a8ece071 100644 (file)
@@ -3,7 +3,7 @@
    Nick Mathewson
 """
 import unittest
-from test.test_support import run_unittest, is_jython
+from test.support import run_unittest, is_jython
 
 from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT
 import io
index b1664f4f1d98b367c17620b9cfb66d962053a27e..ade8bdfde9250473e341013118fb82c07b6f2759 100644 (file)
@@ -1,6 +1,6 @@
 
-import test.test_support, unittest
-from test.test_support import TESTFN, unlink
+import test.support, unittest
+from test.support import TESTFN, unlink
 import os, sys
 
 class CodingTest(unittest.TestCase):
@@ -50,7 +50,7 @@ class CodingTest(unittest.TestCase):
             sys.path.pop(0)
 
 def test_main():
-    test.test_support.run_unittest(CodingTest)
+    test.support.run_unittest(CodingTest)
 
 if __name__ == "__main__":
     test_main()
index 93847444fe2307e44bb1c89fe0388d97cd395cd0..ad8c2302dd9ecf092f92bf16ea62987b55273af8 100644 (file)
@@ -1,7 +1,7 @@
 """Unit tests for collections.py."""
 
 import unittest, doctest
-from test import test_support
+from test import support
 from collections import namedtuple
 from collections import Hashable, Iterable, Iterator
 from collections import Sized, Container, Callable
@@ -321,8 +321,8 @@ import doctest, collections
 def test_main(verbose=None):
     NamedTupleDocs = doctest.DocTestSuite(module=collections)
     test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, TestCollectionABCs]
-    test_support.run_unittest(*test_classes)
-    test_support.run_doctest(collections, verbose)
+    support.run_unittest(*test_classes)
+    support.run_doctest(collections, verbose)
 
 
 if __name__ == "__main__":
index a8cd885db1252d7e202a337dcee8fbbf51c62993..e405b8a4d033f079eeefdb28919179f379c2e3af 100644 (file)
@@ -1,4 +1,4 @@
-import unittest, test.test_support
+import unittest, test.support
 import colorsys
 
 def frange(start, stop, step):
@@ -70,7 +70,7 @@ class ColorsysTest(unittest.TestCase):
             self.assertTripleEqual(rgb, colorsys.hls_to_rgb(*hls))
 
 def test_main():
-    test.test_support.run_unittest(ColorsysTest)
+    test.support.run_unittest(ColorsysTest)
 
 if __name__ == "__main__":
     test_main()
index 1b84306092635dd1807d153bb078d022c456912d..b4e48ced7daefd48146f65a79615ecc268f15447 100644 (file)
@@ -5,7 +5,7 @@
 import unittest
 import os, tempfile, re
 
-from test.test_support import TestSkipped, run_unittest, reap_children
+from test.support import TestSkipped, run_unittest, reap_children
 from commands import *
 
 # The module says:
index de32f3cc403f1b431846f67e03de7e5fac182969..ee3794ae9a3dc810f92a01ae1f00f9b2322a4918 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 
 class Empty:
     def __repr__(self):
@@ -61,7 +61,7 @@ class ComparisonTest(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(ComparisonTest)
+    support.run_unittest(ComparisonTest)
 
 if __name__ == '__main__':
     test_main()
index 5a069d36073028b75d5b0ef882078a24353c5595..2462269b26a07c0f6a176796cd777601b6c85fbb 100644 (file)
@@ -1,7 +1,7 @@
 import unittest
 import sys
 import _ast
-from test import test_support
+from test import support
 
 class TestSpecifics(unittest.TestCase):
 
@@ -444,7 +444,7 @@ if 1:
 
 
 def test_main():
-    test_support.run_unittest(TestSpecifics)
+    support.run_unittest(TestSpecifics)
 
 if __name__ == "__main__":
     test_main()
index fbed4f285c6c94fa9fc14ec2459ce26d5c7ef28e..44c8999b6faefba3a9ec0948aeba6a78d0fb8012 100644 (file)
@@ -1,5 +1,5 @@
 import unittest, os
-from test import test_support
+from test import support
 
 from random import random
 from math import atan2
@@ -339,16 +339,16 @@ class ComplexTest(unittest.TestCase):
 
         fo = None
         try:
-            fo = open(test_support.TESTFN, "w")
+            fo = open(support.TESTFN, "w")
             print(a, b, file=fo)
             fo.close()
-            fo = open(test_support.TESTFN, "r")
+            fo = open(support.TESTFN, "r")
             self.assertEqual(fo.read(), ("%s %s\n" % (a, b)))
         finally:
             if (fo is not None) and (not fo.closed):
                 fo.close()
             try:
-                os.remove(test_support.TESTFN)
+                os.remove(support.TESTFN)
             except (OSError, IOError):
                 pass
 
@@ -360,7 +360,7 @@ class ComplexTest(unittest.TestCase):
             self.assertEquals(atan2(z2.imag, -1.), atan2(-0., -1.))
 
 def test_main():
-    test_support.run_unittest(ComplexTest)
+    support.run_unittest(ComplexTest)
 
 if __name__ == "__main__":
     test_main()
index 5ab80e489deef521f4848b31ff03788f05895426..e5707874489f187167780d3a3a9eeb3a288cb510 100644 (file)
@@ -1,4 +1,4 @@
-from test.test_support import run_unittest
+from test.support import run_unittest
 import unittest
 
 
index 51d2436ee8a40afd9fbd58e95ca795542db8a09c..c05f37b0ba4e3cb7dc1961d15638cf04d04ab2b5 100644 (file)
@@ -8,7 +8,7 @@ import tempfile
 import unittest
 import threading
 from contextlib import *  # Tests __all__
-from test import test_support
+from test import support
 
 class ContextManagerTestCase(unittest.TestCase):
 
@@ -331,7 +331,7 @@ class LockContextTestCase(unittest.TestCase):
 
 # This is needed to make the test actually run under regrtest.py!
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index e4c8975818a28539c7cd0776f7befbd96a55bf44..07d29e14730c12a206b872ba7ff4201bfa3b433b 100644 (file)
@@ -1,6 +1,6 @@
 # Simple test suite for Cookie.py
 
-from test.test_support import run_unittest, run_doctest
+from test.support import run_unittest, run_doctest
 import unittest
 import Cookie
 
index 87f118d1e116abb1850d6594a9c721a035317f25..e400bfab415b7fd1ce009740d809d71597d5161d 100644 (file)
@@ -3,7 +3,7 @@
 import re, os, time
 from unittest import TestCase
 
-from test import test_support
+from test import support
 
 class DateTimeTests(TestCase):
 
@@ -234,7 +234,7 @@ class FileCookieJarTests(TestCase):
     def test_lwp_valueless_cookie(self):
         # cookies with no value should be saved and loaded consistently
         from cookielib import LWPCookieJar
-        filename = test_support.TESTFN
+        filename = support.TESTFN
         c = LWPCookieJar()
         interact_netscape(c, "http://www.acme.com/", 'boo')
         self.assertEqual(c._cookies["www.acme.com"]["/"]["boo"].value, None)
@@ -250,7 +250,7 @@ class FileCookieJarTests(TestCase):
     def test_bad_magic(self):
         from cookielib import LWPCookieJar, MozillaCookieJar, LoadError
         # IOErrors (eg. file doesn't exist) are allowed to propagate
-        filename = test_support.TESTFN
+        filename = support.TESTFN
         for cookiejar_class in LWPCookieJar, MozillaCookieJar:
             c = cookiejar_class()
             try:
@@ -356,7 +356,7 @@ class CookieTests(TestCase):
 
         # missing = sign in Cookie: header is regarded by Mozilla as a missing
         # name, and by cookielib as a missing value
-        filename = test_support.TESTFN
+        filename = support.TESTFN
         c = MozillaCookieJar(filename)
         interact_netscape(c, "http://www.acme.com/", 'eggs')
         interact_netscape(c, "http://www.acme.com/", '"spam"; path=/foo/')
@@ -1505,7 +1505,7 @@ class LWPCookieTests(TestCase):
         self.assertEquals(len(c), 6)
 
         # save and restore
-        filename = test_support.TESTFN
+        filename = support.TESTFN
 
         try:
             c.save(filename, ignore_discard=True)
@@ -1547,7 +1547,7 @@ class LWPCookieTests(TestCase):
 
         year_plus_one = time.localtime()[0] + 1
 
-        filename = test_support.TESTFN
+        filename = support.TESTFN
 
         c = MozillaCookieJar(filename,
                              policy=DefaultCookiePolicy(rfc2965=True))
@@ -1722,7 +1722,7 @@ class LWPCookieTests(TestCase):
 
 
 def test_main(verbose=None):
-    test_support.run_unittest(
+    support.run_unittest(
         DateTimeTests,
         HeaderTests,
         CookieTests,
index 182b8c3dc618f38c84811938c76718df760ccc2a..500fa83f11277ca6381876d278ea0fcb5629dbe2 100644 (file)
@@ -4,7 +4,7 @@ import copy
 import copyreg
 
 import unittest
-from test import test_support
+from test import support
 
 class TestCopy(unittest.TestCase):
 
@@ -50,7 +50,7 @@ class TestCopy(unittest.TestCase):
             def __reduce_ex__(self, proto):
                 return ""
             def __reduce__(self):
-                raise test_support.TestFailed("shouldn't call this")
+                raise support.TestFailed("shouldn't call this")
         x = C()
         y = copy.copy(x)
         self.assert_(y is x)
@@ -223,7 +223,7 @@ class TestCopy(unittest.TestCase):
             def __reduce_ex__(self, proto):
                 return ""
             def __reduce__(self):
-                raise test_support.TestFailed("shouldn't call this")
+                raise support.TestFailed("shouldn't call this")
         x = C()
         y = copy.deepcopy(x)
         self.assert_(y is x)
@@ -584,7 +584,7 @@ class TestCopy(unittest.TestCase):
 def global_foo(x, y): return x+y
 
 def test_main():
-    test_support.run_unittest(TestCopy)
+    support.run_unittest(TestCopy)
 
 if __name__ == "__main__":
     test_main()
index 82f6c94e89e648e1a1b0dd849d72742add4fd50c..48e58ea29ef9ff55b2f8bdac34bc158964ac7f75 100644 (file)
@@ -1,7 +1,7 @@
 import copyreg
 import unittest
 
-from test import test_support
+from test import support
 from test.pickletester import ExtensionSaver
 
 class C:
@@ -114,7 +114,7 @@ class CopyRegTestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(CopyRegTestCase)
+    support.run_unittest(CopyRegTestCase)
 
 
 if __name__ == "__main__":
index aa07f495dba66f99427ca3deb305a7a33b250a29..b4d0ac97c6e542d31d86fa548ac903d4febf46c7 100755 (executable)
@@ -1,4 +1,4 @@
-from test import test_support
+from test import support
 import unittest
 import crypt
 
@@ -6,11 +6,11 @@ class CryptTestCase(unittest.TestCase):
 
     def test_crypt(self):
         c = crypt.crypt('mypassword', 'ab')
-        if test_support.verbose:
+        if support.verbose:
             print('Test encryption: ', c)
 
 def test_main():
-    test_support.run_unittest(CryptTestCase)
+    support.run_unittest(CryptTestCase)
 
 if __name__ == "__main__":
     test_main()
index f53c5ea36f7ddcec8b640fc781ebcbec57ac545f..1dbb71a8bbb1dd94fca647390e5bf435b22e18c6 100644 (file)
@@ -10,7 +10,7 @@ from io import StringIO, BytesIO
 from tempfile import TemporaryFile
 import csv
 import gc
-from test import test_support
+from test import support
 
 class Test_Csv(unittest.TestCase):
     """
@@ -790,7 +790,7 @@ Stonecutters Seafood and Chop House, Lemont, IL, 12/19/02, Week Back
         self.assertEqual(dialect.quotechar, "'")
 
 if not hasattr(sys, "gettotalrefcount"):
-    if test_support.verbose: print("*** skipping leakage tests ***")
+    if support.verbose: print("*** skipping leakage tests ***")
 else:
     class NUL:
         def write(s, *args):
@@ -891,7 +891,7 @@ class TestUnicode(unittest.TestCase):
 
 def test_main():
     mod = sys.modules[__name__]
-    test_support.run_unittest(
+    support.run_unittest(
         *[getattr(mod, name) for name in dir(mod) if name.startswith('Test')]
     )
 
index 7a81ab4c5548658785c8d026321111e9fdc2c070..92c98ada28493476c6915a8ed13bfacb0c5e1916 100644 (file)
@@ -1,6 +1,6 @@
 import unittest
 
-from test.test_support import run_unittest
+from test.support import run_unittest
 import ctypes.test
 
 def test_main():
index d50d81dfe4843035d190352305180dec4034d45e..ebeb926320857b94c8c0410034c18845f07210ce 100644 (file)
@@ -16,7 +16,7 @@ import curses.panel
 # 'curses' resource be given on the regrtest command line using the -u
 # option.  If not available, nothing after this line will be executed.
 
-from test.test_support import requires, TestSkipped
+from test.support import requires, TestSkipped
 requires('curses')
 
 # XXX: if newterm was supported we could use it instead of initscr and not exit
index e83048ec78018c3b9472d6b947c55fefe8b41083..2048fa0a426cbaaa69def9e87ebc3c7f4d703cc0 100644 (file)
@@ -7,7 +7,7 @@ import os
 import pickle
 import unittest
 
-from test import test_support
+from test import support
 
 from datetime import MINYEAR, MAXYEAR
 from datetime import timedelta
@@ -3340,7 +3340,7 @@ class Oddballs(unittest.TestCase):
         self.assertEqual(datetime_sc, as_datetime)
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index 44b712c3c6a04e41635d72ed96d0fe31b62f7873..2c6ce9902a9eb16ac7831b2b5b635516a48b0572 100755 (executable)
@@ -1,4 +1,4 @@
-from test import test_support
+from test import support
 import unittest
 import os
 import random
@@ -8,13 +8,13 @@ from dbm import error
 class DbmTestCase(unittest.TestCase):
 
     def setUp(self):
-        self.filename = test_support.TESTFN
+        self.filename = support.TESTFN
         self.d = dbm.open(self.filename, 'c')
         self.d.close()
 
     def tearDown(self):
         for suffix in ['', '.pag', '.dir', '.db']:
-            test_support.unlink(self.filename + suffix)
+            support.unlink(self.filename + suffix)
 
     def test_keys(self):
         self.d = dbm.open(self.filename, 'c')
@@ -34,7 +34,7 @@ class DbmTestCase(unittest.TestCase):
                 self.fail()
 
 def test_main():
-    test_support.run_unittest(DbmTestCase)
+    support.run_unittest(DbmTestCase)
 
 if __name__ == '__main__':
     test_main()
index b4f942ec0bc14feb7c1020606c88826f73813c7b..617f4d97cfa759501cb107c2de18ea03ce8c128e 100644 (file)
@@ -30,7 +30,7 @@ import os, sys
 import pickle, copy
 import unittest
 from decimal import *
-from test.test_support import (TestSkipped, run_unittest, run_doctest,
+from test.support import (TestSkipped, run_unittest, run_doctest,
                                is_resource_enabled)
 import random
 try:
index 1499004154ee7b161129c89dacd7e8662cf7fe5f..53c9469112290f259ba7bf31fde8d94616c571ac 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 
 def funcattrs(**kwds):
     def decorate(func):
@@ -302,8 +302,8 @@ class TestClassDecorators(unittest.TestCase):
         self.assertEqual(C.extra, 'second')
 
 def test_main():
-    test_support.run_unittest(TestDecorators)
-    test_support.run_unittest(TestClassDecorators)
+    support.run_unittest(TestDecorators)
+    support.run_unittest(TestClassDecorators)
 
 if __name__=="__main__":
     test_main()
index 065cc1020302be249a12e79580a98d0b18fa2b01..49519ab06a06484c1d86a1fc07cdf4e802c7517a 100644 (file)
@@ -4,7 +4,7 @@ import os
 import copy
 import tempfile
 import unittest
-from test import test_support
+from test import support
 
 from collections import defaultdict
 
@@ -166,7 +166,7 @@ class TestDefaultDict(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(TestDefaultDict)
+    support.run_unittest(TestDefaultDict)
 
 if __name__ == "__main__":
     test_main()
index cb5957928d4e20c5ebd38837be51e1fc67bc4117..1ac43dad27bfcc7f9a9f268677ee6162bec2915e 100644 (file)
@@ -1,6 +1,6 @@
 from collections import deque
 import unittest
-from test import test_support, seq_tests
+from test import support, seq_tests
 from weakref import proxy
 import copy
 import pickle
@@ -64,28 +64,28 @@ class TestBasic(unittest.TestCase):
         self.assertEqual(list(d), [7, 8, 9])
         d = deque(range(200), maxlen=10)
         d.append(d)
-        test_support.unlink(test_support.TESTFN)
-        fo = open(test_support.TESTFN, "w")
+        support.unlink(support.TESTFN)
+        fo = open(support.TESTFN, "w")
         try:
             fo.write(str(d))
             fo.close()
-            fo = open(test_support.TESTFN, "r")
+            fo = open(support.TESTFN, "r")
             self.assertEqual(fo.read(), repr(d))
         finally:
             fo.close()
-            test_support.unlink(test_support.TESTFN)
+            support.unlink(support.TESTFN)
 
         d = deque(range(10), maxlen=None)
         self.assertEqual(repr(d), 'deque([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])')
-        fo = open(test_support.TESTFN, "w")
+        fo = open(support.TESTFN, "w")
         try:
             fo.write(str(d))
             fo.close()
-            fo = open(test_support.TESTFN, "r")
+            fo = open(support.TESTFN, "r")
             self.assertEqual(fo.read(), repr(d))
         finally:
             fo.close()
-            test_support.unlink(test_support.TESTFN)
+            support.unlink(support.TESTFN)
 
     def test_comparisons(self):
         d = deque('xabc'); d.popleft()
@@ -284,15 +284,15 @@ class TestBasic(unittest.TestCase):
         d = deque(range(200))
         d.append(d)
         try:
-            test_support.unlink(test_support.TESTFN)
-            fo = open(test_support.TESTFN, "w")
+            support.unlink(support.TESTFN)
+            fo = open(support.TESTFN, "w")
             print(d, file=fo, end='')
             fo.close()
-            fo = open(test_support.TESTFN, "r")
+            fo = open(support.TESTFN, "r")
             self.assertEqual(fo.read(), repr(d))
         finally:
             fo.close()
-            test_support.unlink(test_support.TESTFN)
+            support.unlink(support.TESTFN)
 
     def test_init(self):
         self.assertRaises(TypeError, deque, 'abc', 2, 3);
@@ -670,21 +670,21 @@ def test_main(verbose=None):
         TestSubclassWithKwargs,
     )
 
-    test_support.run_unittest(*test_classes)
+    support.run_unittest(*test_classes)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_unittest(*test_classes)
+            support.run_unittest(*test_classes)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
 
     # doctests
     from test import test_deque
-    test_support.run_doctest(test_deque, verbose)
+    support.run_doctest(test_deque, verbose)
 
 if __name__ == "__main__":
     test_main(verbose=True)
index 288afd48c1026df949c0b77ca145d5333cd72694..ad649cb176bbfb91b162806372e4d39a5a32e6f0 100644 (file)
@@ -3,7 +3,7 @@ import unittest
 import warnings
 
 from copy import deepcopy
-from test import test_support
+from test import support
 
 
 class OperatorsTest(unittest.TestCase):
@@ -2449,12 +2449,12 @@ order (MRO) for bases """
         ##             self.ateof = 1
         ##        return s
         ##
-        ## f = file(name=test_support.TESTFN, mode='w')
+        ## f = file(name=support.TESTFN, mode='w')
         ## lines = ['a\n', 'b\n', 'c\n']
         ## try:
         ##     f.writelines(lines)
         ##     f.close()
-        ##     f = CountedInput(test_support.TESTFN)
+        ##     f = CountedInput(support.TESTFN)
         ##     for (i, expected) in zip(range(1, 5) + [4], lines + 2 * [""]):
         ##         got = f.readline()
         ##         self.assertEqual(expected, got)
@@ -2466,7 +2466,7 @@ order (MRO) for bases """
         ##         f.close()
         ##     except:
         ##         pass
-        ##     test_support.unlink(test_support.TESTFN)
+        ##     support.unlink(support.TESTFN)
 
     def test_keywords(self):
         # Testing keyword args to basic type constructors ...
@@ -4093,7 +4093,7 @@ class PTypesLongInitTest(unittest.TestCase):
 
 def test_main():
     # Run all local test cases, with PTypesLongInitTest first.
-    test_support.run_unittest(PTypesLongInitTest, OperatorsTest,
+    support.run_unittest(PTypesLongInitTest, OperatorsTest,
                               ClassPropertiesAndMethods, DictProxyTests)
 
 if __name__ == "__main__":
index 1ddab0e5463a6037fe6229375c37d6e042b08f62..bd298bdd8cb182c06f7629d69e438870c258a7aa 100644 (file)
@@ -8,7 +8,7 @@
 # of much interest anymore), and a few were fiddled to make the output
 # deterministic.
 
-from test.test_support import sortdict
+from test.support import sortdict
 import pprint
 
 class defaultdict(dict):
@@ -473,8 +473,8 @@ def test_main(verbose=None):
     # into the doctest examples, and unless the full test.test_descrtut
     # business is used the name can change depending on how the test is
     # invoked.
-    from test import test_support, test_descrtut
-    test_support.run_doctest(test_descrtut, verbose)
+    from test import support, test_descrtut
+    support.run_doctest(test_descrtut, verbose)
 
 # This part isn't needed for regrtest, but for running the test directly.
 if __name__ == "__main__":
index 01d47da659367276a21538824cc015530d6fb274..b518a0bb02b7320f7da0c9f6975f367b105e5a4a 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 
 import sys, collections, random, string
 
@@ -651,7 +651,7 @@ class SubclassMappingTests(mapping_tests.BasicTestMappingProtocol):
     type2test = Dict
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         DictTest,
         GeneralMappingTests,
         SubclassMappingTests,
index 9af9e48b2cc2622a4f9046f3354eba36ad18d49e..a3b22dc45062c9628a5c713b5ac7472f493ed26b 100644 (file)
@@ -36,16 +36,16 @@ __test__ = {'doctests' : doctests}
 
 def test_main(verbose=None):
     import sys
-    from test import test_support
+    from test import support
     from test import test_dictcomps
-    test_support.run_doctest(test_dictcomps, verbose)
+    support.run_doctest(test_dictcomps, verbose)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_doctest(test_dictcomps, verbose)
+            support.run_doctest(test_dictcomps, verbose)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
index 3a5fce6e7abcb1e48518937e541f1e3eb1e8b3ae..34883d21c01599eb614c1e5c6d6509543a8a6a2a 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 
 class DictSetTest(unittest.TestCase):
 
@@ -70,7 +70,7 @@ class DictSetTest(unittest.TestCase):
         self.assertEqual(len(values), 2)
 
 def test_main():
-    test_support.run_unittest(DictSetTest)
+    support.run_unittest(DictSetTest)
 
 if __name__ == "__main__":
     test_main()
index b5168dd7094fd1629705f162e897ec3bad369755..8425a208866bb5ef5ae34068580784832b88cad6 100644 (file)
@@ -1,5 +1,5 @@
 import difflib
-from test.test_support import run_unittest, findfile
+from test.support import run_unittest, findfile
 import unittest
 import doctest
 import sys
index ceb7509825c5fa858e7f26ffe0bd2d09581bb5d8..cf62ecfdfef0b8632ba9d55ae9b8e880f3d70ecc 100644 (file)
@@ -1,6 +1,6 @@
 # Minimal tests for dis module
 
-from test.test_support import run_unittest
+from test.support import run_unittest
 import unittest
 import sys
 import dis
index fcd792d945a241ab2447ef70f316770fe7b6075a..94e59bc58acb2bc2251560ef57b6d87ec283a825 100644 (file)
@@ -6,11 +6,11 @@ be run.
 """
 
 import distutils.tests
-import test.test_support
+import test.support
 
 
 def test_main():
-    test.test_support.run_unittest(distutils.tests.test_suite())
+    test.support.run_unittest(distutils.tests.test_suite())
 
 
 if __name__ == "__main__":
index af70162aa74cf8536201b7bc7f150cac25a2f008..f07da75011d650c71698b3114c7e626435e6139d 100644 (file)
@@ -2,7 +2,7 @@
 Test script for doctest.
 """
 
-from test import test_support
+from test import support
 import doctest
 import warnings
 
@@ -2291,10 +2291,10 @@ using the optional keyword argument `encoding`:
 
 def test_main():
     # Check the doctest cases in doctest itself:
-    test_support.run_doctest(doctest, verbosity=True)
+    support.run_doctest(doctest, verbosity=True)
     # Check the doctest cases defined here:
     from test import test_doctest
-    test_support.run_doctest(test_doctest, verbosity=True)
+    support.run_doctest(test_doctest, verbosity=True)
 
 import trace, sys, re, io
 def test_coverage(coverdir):
index eb39ab980e133893b9a022830eb6b43d659c9f8d..86334d70d893448d17782a9dd4a2c93ffbeb78ed 100644 (file)
@@ -12,7 +12,7 @@ the example.  It should be ignored:
 
 """
 
-from test import test_support
+from test import support
 
 class C(object):
     """Class C.
@@ -107,9 +107,9 @@ class C(object):
 def test_main():
     from test import test_doctest2
     EXPECTED = 19
-    f, t = test_support.run_doctest(test_doctest2)
+    f, t = support.run_doctest(test_doctest2)
     if t != EXPECTED:
-        raise test_support.TestFailed("expected %d tests to run, not %d" %
+        raise support.TestFailed("expected %d tests to run, not %d" %
                                       (EXPECTED, t))
 
 # Pollute the namespace with a bunch of imported functions and classes,
index c9984b36af22e3301304a66e32137c3f143dc8c1..2af20716b0464440df92b713bdbbdf0982ebbb63 100644 (file)
@@ -1,6 +1,6 @@
 from DocXMLRPCServer import DocXMLRPCServer
 import httplib
-from test import test_support
+from test import support
 import threading
 import time
 import unittest
@@ -145,7 +145,7 @@ b"""<dl><dt><a name="-system.methodHelp"><strong>system.methodHelp</strong></a>(
             response.read())
 
 def test_main():
-    test_support.run_unittest(DocXMLRPCHTTPGETServer)
+    support.run_unittest(DocXMLRPCHTTPGETServer)
 
 if __name__ == '__main__':
     test_main()
index 9a2cb682a0787bab32298eb1e1485ad8c61ec547..24c178ffd9c0bf111f302e1e48ce64a4f48cb71c 100644 (file)
@@ -7,9 +7,9 @@ import io
 import os
 import unittest
 import dumbdbm
-from test import test_support
+from test import support
 
-_fname = test_support.TESTFN
+_fname = support.TESTFN
 
 def _delete_files():
     for ext in [".dir", ".dat", ".bak"]:
@@ -177,7 +177,7 @@ class DumbDBMTestCase(unittest.TestCase):
 
 def test_main():
     try:
-        test_support.run_unittest(DumbDBMTestCase)
+        support.run_unittest(DumbDBMTestCase)
     finally:
         _delete_files()
 
index 59104587f960befd0bee44c78d7176fdecb78965..585711f22b3e6f35057253d3164072ced56a9846 100644 (file)
@@ -10,7 +10,7 @@ import time
 import queue
 import random
 import unittest
-from test import test_support
+from test import support
 
 DELAY = 0 # Set > 0 when testing a module other than dummy_thread, such as
           # the 'thread' module.
@@ -71,13 +71,13 @@ class LockTests(unittest.TestCase):
         self.lock.acquire()
         start_time = int(time.time())
         _thread.start_new_thread(delay_unlock,(self.lock, DELAY))
-        if test_support.verbose:
+        if support.verbose:
             print()
             print("*** Waiting for thread to release the lock "\
             "(approx. %s sec.) ***" % DELAY)
         self.lock.acquire()
         end_time = int(time.time())
-        if test_support.verbose:
+        if support.verbose:
             print("done")
         self.failUnless((end_time - start_time) >= DELAY,
                         "Blocking by unconditional acquiring failed.")
@@ -149,7 +149,7 @@ class ThreadTests(unittest.TestCase):
 
         thread_count = 5
         testing_queue = queue.Queue(thread_count)
-        if test_support.verbose:
+        if support.verbose:
             print()
             print("*** Testing multiple thread creation "\
             "(will take approx. %s to %s sec.) ***" % (DELAY, thread_count))
@@ -161,7 +161,7 @@ class ThreadTests(unittest.TestCase):
             _thread.start_new_thread(queue_mark,
                                      (testing_queue, local_delay))
         time.sleep(DELAY)
-        if test_support.verbose:
+        if support.verbose:
             print('done')
         self.failUnless(testing_queue.qsize() == thread_count,
                         "Not all %s threads executed properly after %s sec." %
@@ -172,10 +172,10 @@ def test_main(imported_module=None):
     if imported_module:
         _thread = imported_module
         DELAY = 2
-    if test_support.verbose:
+    if support.verbose:
         print()
         print("*** Using %s as _thread module ***" % _thread)
-    test_support.run_unittest(LockTests, MiscTests, ThreadTests)
+    support.run_unittest(LockTests, MiscTests, ThreadTests)
 
 if __name__ == '__main__':
     test_main()
index 2d0dadd4cc870cd45fad6d14da7dbe8920c4b90c..4e983ce4b6d5aec54e060d5cc01f88e4d92b498a 100644 (file)
@@ -1,4 +1,4 @@
-from test import test_support
+from test import support
 import unittest
 import dummy_threading as _threading
 import time
@@ -15,20 +15,20 @@ class DummyThreadingTestCase(unittest.TestCase):
             # module.
             #delay = random.random() * 2
             delay = 0
-            if test_support.verbose:
+            if support.verbose:
                 print('task', self.getName(), 'will run for', delay, 'sec')
             sema.acquire()
             mutex.acquire()
             running += 1
-            if test_support.verbose:
+            if support.verbose:
                 print(running, 'tasks are running')
             mutex.release()
             time.sleep(delay)
-            if test_support.verbose:
+            if support.verbose:
                 print('task', self.getName(), 'done')
             mutex.acquire()
             running -= 1
-            if test_support.verbose:
+            if support.verbose:
                 print(self.getName(), 'is finished.', running, 'tasks are running')
             mutex.release()
             sema.release()
@@ -49,15 +49,15 @@ class DummyThreadingTestCase(unittest.TestCase):
             self.threads.append(t)
             t.start()
 
-        if test_support.verbose:
+        if support.verbose:
             print('waiting for all tasks to complete')
         for t in self.threads:
             t.join()
-        if test_support.verbose:
+        if support.verbose:
             print('all tasks done')
 
 def test_main():
-    test_support.run_unittest(DummyThreadingTestCase)
+    support.run_unittest(DummyThreadingTestCase)
 
 
 if __name__ == '__main__':
index e12cbd36f415982e870db922551cbfc4f25fc076..f0a18e71d02c0e7d85123e1a3fac8259c05b72f9 100644 (file)
@@ -3,10 +3,10 @@
 
 # The specific tests now live in Lib/email/test
 from email.test.test_email import suite
-from test import test_support
+from test import support
 
 def test_main():
-    test_support.run_unittest(suite())
+    support.run_unittest(suite())
 
 if __name__ == '__main__':
     test_main()
index f5c568995b11d3c3a3ea28b461d0136abe2924b6..cdb9e7e411e407af15b4a92b6ebfdabc79de3c07 100644 (file)
@@ -1,7 +1,7 @@
 import unittest
 import sys
 
-from test import test_support
+from test import support
 
 class G:
     'Sequence using __getitem__'
@@ -215,14 +215,14 @@ class TestLongStart(EnumerateTestCase):
 def test_main(verbose=None):
     testclasses = (EnumerateTestCase, SubclassTestCase, TestEmpty, TestBig,
                    TestReversed)
-    test_support.run_unittest(*testclasses)
+    support.run_unittest(*testclasses)
 
     # verify reference counting
     import sys
     if verbose and hasattr(sys, "gettotalrefcount"):
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_unittest(*testclasses)
+            support.run_unittest(*testclasses)
             counts[i] = sys.gettotalrefcount()
         print(counts)
 
index 91fd845551b66ac9fe9e07712dbb72626721f894..4e37560a3d6142516228bf92de91cbaf0a4575ab 100644 (file)
@@ -2,7 +2,7 @@
 """test script for a few new invalid token catches"""
 
 import unittest
-from test import test_support
+from test import support
 
 class EOFTestCase(unittest.TestCase):
     def test_EOFC(self):
@@ -13,7 +13,7 @@ class EOFTestCase(unittest.TestCase):
         except SyntaxError as msg:
             self.assertEqual(str(msg), expect)
         else:
-            raise test_support.TestFailed
+            raise support.TestFailed
 
     def test_EOFS(self):
         expect = ("EOF while scanning triple-quoted string literal "
@@ -23,10 +23,10 @@ class EOFTestCase(unittest.TestCase):
         except SyntaxError as msg:
             self.assertEqual(str(msg), expect)
         else:
-            raise test_support.TestFailed
+            raise support.TestFailed
 
 def test_main():
-    test_support.run_unittest(EOFTestCase)
+    support.run_unittest(EOFTestCase)
 
 if __name__ == "__main__":
     test_main()
index 1e30d61c506e7989bd6635c0da7d3a1814ff45b8..b1ca322669888a0f3e110ae694f2943f159503ef 100644 (file)
@@ -29,15 +29,15 @@ import select
 import tempfile
 import unittest
 
-from test import test_support
+from test import support
 if not hasattr(select, "epoll"):
-    raise test_support.TestSkipped("test works only on Linux 2.6")
+    raise support.TestSkipped("test works only on Linux 2.6")
 
 try:
     select.epoll()
 except IOError as e:
     if e.errno == errno.ENOSYS:
-        raise test_support.TestSkipped("kernel doesn't support epoll()")
+        raise support.TestSkipped("kernel doesn't support epoll()")
 
 class TestEPoll(unittest.TestCase):
 
@@ -189,7 +189,7 @@ class TestEPoll(unittest.TestCase):
         ep.unregister(fd)
 
 def test_main():
-    test_support.run_unittest(TestEPoll)
+    support.run_unittest(TestEPoll)
 
 if __name__ == "__main__":
     test_main()
index 30771910afee70682be218819d66959d2bb19383..28425e2057313a8b1fa7ee5461c24584ef366883 100755 (executable)
@@ -4,7 +4,7 @@
 """
 
 import errno
-from test import test_support
+from test import support
 import unittest
 
 std_c_errors = frozenset(['EDOM', 'ERANGE'])
@@ -33,7 +33,7 @@ class ErrorcodeTests(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(ErrnoAttributeTests, ErrorcodeTests)
+    support.run_unittest(ErrnoAttributeTests, ErrorcodeTests)
 
 
 if __name__ == '__main__':
index 5bcb8fce0a8aaa78d17e617b02553fa1eb22462a..11f5e5c84e3bd4d35a3ec1c11cb298b083d0c09a 100644 (file)
@@ -1,5 +1,5 @@
 
-from test.test_support import run_unittest
+from test.support import run_unittest
 import unittest
 
 class ExceptionTestCase(unittest.TestCase):
index 0574356d133e13784d82a1bf980dde0c9574e97e..619b7e3234a8346c3d83335daa882e083dc0e3fc 100644 (file)
@@ -6,7 +6,7 @@ import unittest
 import pickle
 import weakref
 
-from test.test_support import TESTFN, unlink, run_unittest
+from test.support import TESTFN, unlink, run_unittest
 
 # XXX This is not really enough, each *operation* should be tested!
 
index 3cf7ac2df2b44df7038c29d4483b7d785d1bc0c1..7ed0e2e11998bb5bf0746db751d9eb749ae33d49 100644 (file)
@@ -11,10 +11,10 @@ We're defining four helper functions
     ...     print(a, b)
 
     >>> def f(*a, **k):
-    ...     print(a, test_support.sortdict(k))
+    ...     print(a, support.sortdict(k))
 
     >>> def g(x, *y, **z):
-    ...     print(x, y, test_support.sortdict(z))
+    ...     print(x, y, support.sortdict(z))
 
     >>> def h(j=1, a=2, h=3):
     ...     print(j, a, h)
@@ -245,11 +245,11 @@ TypeError if te dictionary is not empty
 
 """
 
-from test import test_support
+from test import support
 
 def test_main():
     from test import test_extcall # self import
-    test_support.run_doctest(test_extcall, True)
+    support.run_doctest(test_extcall, True)
 
 if __name__ == '__main__':
     test_main()
index 136961237a53e276d59317b2af3058fec66fc3c8..afb511cd063d7eddc4c40347b2babea472fcec88 100755 (executable)
@@ -8,7 +8,7 @@ import os
 import struct
 import sys
 import unittest
-from test.test_support import verbose, TESTFN, unlink, run_unittest
+from test.support import verbose, TESTFN, unlink, run_unittest
 
 # TODO - Write tests for flock() and lockf().
 
index 5102de3e44d8ff465069602d5ce5e9c6f484ec6d..ff4996ae482785eb23b34e81ddaf7455302b7ba6 100644 (file)
@@ -4,7 +4,7 @@ import unittest
 from array import array
 from weakref import proxy
 
-from test.test_support import TESTFN, findfile, run_unittest
+from test.support import TESTFN, findfile, run_unittest
 from collections import UserList
 
 class AutoFileTests(unittest.TestCase):
index 53b949d83214e1d060de572b178264189f40247b..22f0be784477181531cf7dc5681130afa3bf1daf 100644 (file)
@@ -1,13 +1,13 @@
 
 import os, filecmp, shutil, tempfile, shutil
 import unittest
-from test import test_support
+from test import support
 
 class FileCompareTestCase(unittest.TestCase):
     def setUp(self):
-        self.name = test_support.TESTFN
-        self.name_same = test_support.TESTFN + '-same'
-        self.name_diff = test_support.TESTFN + '-diff'
+        self.name = support.TESTFN
+        self.name_same = support.TESTFN + '-same'
+        self.name_diff = support.TESTFN + '-diff'
         data = 'Contents of file go here.\n'
         for name in [self.name, self.name_same, self.name_diff]:
             output = open(name, 'w')
@@ -128,7 +128,7 @@ class DirCompareTestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(FileCompareTestCase, DirCompareTestCase)
+    support.run_unittest(FileCompareTestCase, DirCompareTestCase)
 
 if __name__ == "__main__":
     test_main()
index 76a41a65f6ece650432a952a3659ae333c56d080..a4d59e1240d2b2cfd58a9b6a0240e5f4698e0056 100644 (file)
@@ -4,8 +4,8 @@ Nick Mathewson
 '''
 
 import unittest
-from test.test_support import verbose, TESTFN, run_unittest
-from test.test_support import unlink as safe_unlink
+from test.support import verbose, TESTFN, run_unittest
+from test.support import unlink as safe_unlink
 import sys, re
 from io import StringIO
 from fileinput import FileInput, hook_encoded
index 2f9c23f69e6d44f148eff0e9a273b3f6ffb10e83..c94ceafdeafad679dfec8823868941bab4c4d771 100644 (file)
@@ -6,7 +6,7 @@ import unittest
 from array import array
 from weakref import proxy
 
-from test.test_support import TESTFN, findfile, run_unittest
+from test.support import TESTFN, findfile, run_unittest
 from collections import UserList
 
 import _fileio
index 5653c16070ea4f5517c5117cbcc718f27611ef50..d17400c657c455d472ddb060c552c65f4f3f1b92 100644 (file)
@@ -1,7 +1,7 @@
 
 import unittest, struct
 import os
-from test import test_support
+from test import support
 import math
 from math import isinf, isnan
 import operator
@@ -28,7 +28,7 @@ class GeneralFloatCases(unittest.TestCase):
             # Implementation limitation in PyFloat_FromString()
             self.assertRaises(ValueError, float, unicode("1"*10000))
 
-    @test_support.run_with_locale('LC_NUMERIC', 'fr_FR', 'de_DE')
+    @support.run_with_locale('LC_NUMERIC', 'fr_FR', 'de_DE')
     def test_float_with_comma(self):
         # set locale to something that doesn't use '.' for the decimal point
         # float must not accept the locale specific decimal point but
@@ -361,7 +361,7 @@ class InfNanTest(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         FormatFunctionsTestCase,
         UnknownFormatTestCase,
         IEEEFormatTestCase,
index 9abcbd6f28607b596cc34b3d772d1067c0f36b93..c593704e67492f1bad9385d06e19789e0c58d36c 100644 (file)
@@ -1,6 +1,6 @@
 """Test cases for the fnmatch module."""
 
-from test import test_support
+from test import support
 import unittest
 
 from fnmatch import fnmatch, fnmatchcase
@@ -39,7 +39,7 @@ class FnmatchTestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(FnmatchTestCase)
+    support.run_unittest(FnmatchTestCase)
 
 
 if __name__ == "__main__":
index 221a14d27354bbff4a9c961444947a84f8599235..e6d9eed237099167201f08580261efd538ee69cd 100644 (file)
@@ -4,7 +4,7 @@
 import os
 import time
 from test.fork_wait import ForkWait
-from test.test_support import TestSkipped, run_unittest, reap_children
+from test.support import TestSkipped, run_unittest, reap_children
 
 try:
     os.fork
index cbb7be837a67824bd508b2db9b5c353f9ad1a9e8..fb914756a17f7f609f624ae59dec47ef537795e5 100644 (file)
@@ -1,9 +1,9 @@
-from test.test_support import verbose, TestFailed
+from test.support import verbose, TestFailed
 import sys
-import test.test_support as test_support
+import test.support as support
 import unittest
 
-maxsize = test_support.MAX_Py_ssize_t
+maxsize = support.MAX_Py_ssize_t
 
 # test string formatting operator (I am not sure if this is being tested
 # elsewhere but, surely, some of the given cases are *not* tested because
@@ -256,7 +256,7 @@ class FormatTest(unittest.TestCase):
                 raise TestFailed('"%*d"%(maxsize, -127) should fail')
 
 def test_main():
-    test_support.run_unittest(FormatTest)
+    support.run_unittest(FormatTest)
 
 
 if __name__ == "__main__":
index 21c176107c4081be28e169240e651c08e31da0f4..d06c2062c92541c0525f2614860e47ef4b41237c 100644 (file)
@@ -1,7 +1,7 @@
 """Tests for Lib/fractions.py."""
 
 from decimal import Decimal
-from test.test_support import run_unittest
+from test.support import run_unittest
 import math
 import operator
 import fractions
index de45b23a3753a0edfac3c4e9f5154829c66ed6e9..545941bedc7d277bed5615d4020e1abd9605f510 100644 (file)
@@ -1,6 +1,6 @@
 # Test the frozen module defined in frozen.c.
 
-from test.test_support import captured_stdout, run_unittest
+from test.support import captured_stdout, run_unittest
 import unittest
 import sys, os
 
index 0204c6f5e4c810c3fb271765a3ea983b8f7147f5..b91588a3102e50012b0ab98c5451d7a45ca2cbe6 100644 (file)
@@ -4,9 +4,9 @@ import ftplib
 import time
 
 from unittest import TestCase
-from test import test_support
+from test import support
 
-HOST = test_support.HOST
+HOST = support.HOST
 
 # This function sets the evt 3 times:
 #  1) when the connection is ready to be accepted.
@@ -37,7 +37,7 @@ class GeneralTests(TestCase):
         self.evt = threading.Event()
         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         self.sock.settimeout(3)
-        self.port = test_support.bind_port(self.sock)
+        self.port = support.bind_port(self.sock)
         threading.Thread(target=server, args=(self.evt,self.sock)).start()
         # Wait for the server to be ready.
         self.evt.wait()
@@ -106,7 +106,7 @@ class GeneralTests(TestCase):
 
 
 def test_main(verbose=None):
-    test_support.run_unittest(GeneralTests)
+    support.run_unittest(GeneralTests)
 
 if __name__ == '__main__':
     test_main()
index 7385f96385ceb24c86e06714828635c205e23a4f..5e9f7d3affe6a99dbfe1838e54bb6ff07f4c5db9 100644 (file)
@@ -1,4 +1,4 @@
-from test import test_support
+from test import support
 import types
 import unittest
 
@@ -225,7 +225,7 @@ class FunctionDocstringTest(FuncAttrsTest):
         self.assertEqual(self.b.__doc__, None)
 
 def test_main():
-    test_support.run_unittest(FunctionPropertiesTest, ImplicitReferencesTest,
+    support.run_unittest(FunctionPropertiesTest, ImplicitReferencesTest,
                               ArbitraryFunctionAttrTest, FunctionDictsTest,
                               FunctionDocstringTest)
 
index a1e5d13af3c16830f97c1e672b78c89e7efc5fa2..84e974a8db0a02bc02e39cdb4cf439bd25c1d3b0 100644 (file)
@@ -1,6 +1,6 @@
 import functools
 import unittest
-from test import test_support
+from test import support
 from weakref import proxy
 
 @staticmethod
@@ -347,14 +347,14 @@ def test_main(verbose=None):
         TestWraps,
         TestReduce
     )
-    test_support.run_unittest(*test_classes)
+    support.run_unittest(*test_classes)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_unittest(*test_classes)
+            support.run_unittest(*test_classes)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
index 1437489d9088e4287c45f18d9302b8729f094e39..494f539a36a00b16e0741f14e397fb88b9545146 100644 (file)
@@ -1,7 +1,7 @@
 # Test various flavors of legal and illegal future statements
 
 import unittest
-from test import test_support
+from test import support
 import re
 
 rx = re.compile('\((\S+).py, line (\d+)')
@@ -13,17 +13,17 @@ def get_error_location(msg):
 class FutureTest(unittest.TestCase):
 
     def test_future1(self):
-        test_support.unload('test_future1')
+        support.unload('test_future1')
         from test import test_future1
         self.assertEqual(test_future1.result, 6)
 
     def test_future2(self):
-        test_support.unload('test_future2')
+        support.unload('test_future2')
         from test import test_future2
         self.assertEqual(test_future2.result, 6)
 
     def test_future3(self):
-        test_support.unload('test_future3')
+        support.unload('test_future3')
         from test import test_future3
 
     def test_badfuture3(self):
@@ -104,7 +104,7 @@ class FutureTest(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(FutureTest)
+    support.run_unittest(FutureTest)
 
 if __name__ == "__main__":
     test_main()
index ed23567a7693dc216c9cbcf4d451bf9ce1d88930..b1552a5e8e0146c89e0f76277df3020379212cf3 100644 (file)
@@ -2,7 +2,7 @@ from __future__ import nested_scopes
 from __future__ import division
 
 import unittest
-from test import test_support
+from test import support
 
 x = 2
 def nester():
@@ -24,7 +24,7 @@ class TestFuture(unittest.TestCase):
         self.assertEqual(nester(), 3)
 
 def test_main():
-    test_support.run_unittest(TestFuture)
+    support.run_unittest(TestFuture)
 
 if __name__ == "__main__":
     test_main()
index 8ada489acb7e5e840edecccf992746a61ce65053..c32f27f6161afdeeed3c98647d3a00ee17e446fa 100644 (file)
@@ -1,7 +1,7 @@
 from __future__ import unicode_literals
 
 import unittest
-from test import test_support
+from test import support
 
 def test_main():
     pass
index 9d5e0ea6d082459bfb73a9f4c8adedb62f9fcf21..414e17aa8fc1c18b4c2f78cc051b4c2cebb348b0 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test.test_support import verbose, run_unittest
+from test.support import verbose, run_unittest
 import sys
 import gc
 import weakref
index 17a7f632cf622d53f8e651f0fa62ee7d86e53422..42cb136ac5b950a3a8a9fa84432d44e50daec976 100755 (executable)
@@ -1,7 +1,7 @@
 import gdbm
 import unittest
 import os
-from test.test_support import verbose, TESTFN, run_unittest, unlink
+from test.support import verbose, TESTFN, run_unittest, unlink
 
 
 filename = TESTFN
index 56f23db042df9429ac60d62dc0a3b4bf97e272ae..8f2da7d9e393ec53afed7527dad3cad3388a591d 100644 (file)
@@ -1885,8 +1885,8 @@ __test__ = {"tut":      tutorial_tests,
 # Note that doctest and regrtest both look in sys.argv for a "-v" argument,
 # so this works as expected in both ways of running regrtest.
 def test_main(verbose=None):
-    from test import test_support, test_generators
-    test_support.run_doctest(test_generators, verbose)
+    from test import support, test_generators
+    support.run_doctest(test_generators, verbose)
 
 # This part isn't needed for regrtest, but for running the test directly.
 if __name__ == "__main__":
index d91271446c59a28fff0e4d685cbc46022c8d7d70..9d0baeb8c24bb72e27d344a9e890c620d714af83 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 import os
 import genericpath
 
@@ -27,114 +27,114 @@ class AllCommonTest(unittest.TestCase):
         )
 
     def test_getsize(self):
-        f = open(test_support.TESTFN, "wb")
+        f = open(support.TESTFN, "wb")
         try:
             f.write(b"foo")
             f.close()
-            self.assertEqual(genericpath.getsize(test_support.TESTFN), 3)
+            self.assertEqual(genericpath.getsize(support.TESTFN), 3)
         finally:
             if not f.closed:
                 f.close()
-            os.remove(test_support.TESTFN)
+            os.remove(support.TESTFN)
 
     def test_time(self):
-        f = open(test_support.TESTFN, "wb")
+        f = open(support.TESTFN, "wb")
         try:
             f.write(b"foo")
             f.close()
-            f = open(test_support.TESTFN, "ab")
+            f = open(support.TESTFN, "ab")
             f.write(b"bar")
             f.close()
-            f = open(test_support.TESTFN, "rb")
+            f = open(support.TESTFN, "rb")
             d = f.read()
             f.close()
             self.assertEqual(d, b"foobar")
 
             self.assert_(
-                genericpath.getctime(test_support.TESTFN) <=
-                genericpath.getmtime(test_support.TESTFN)
+                genericpath.getctime(support.TESTFN) <=
+                genericpath.getmtime(support.TESTFN)
             )
         finally:
             if not f.closed:
                 f.close()
-            os.remove(test_support.TESTFN)
+            os.remove(support.TESTFN)
 
     def test_exists(self):
-        self.assertIs(genericpath.exists(test_support.TESTFN), False)
-        f = open(test_support.TESTFN, "wb")
+        self.assertIs(genericpath.exists(support.TESTFN), False)
+        f = open(support.TESTFN, "wb")
         try:
             f.write(b"foo")
             f.close()
-            self.assertIs(genericpath.exists(test_support.TESTFN), True)
+            self.assertIs(genericpath.exists(support.TESTFN), True)
         finally:
             if not f.close():
                 f.close()
             try:
-                os.remove(test_support.TESTFN)
+                os.remove(support.TESTFN)
             except os.error:
                 pass
 
         self.assertRaises(TypeError, genericpath.exists)
 
     def test_isdir(self):
-        self.assertIs(genericpath.isdir(test_support.TESTFN), False)
-        f = open(test_support.TESTFN, "wb")
+        self.assertIs(genericpath.isdir(support.TESTFN), False)
+        f = open(support.TESTFN, "wb")
         try:
             f.write(b"foo")
             f.close()
-            self.assertIs(genericpath.isdir(test_support.TESTFN), False)
-            os.remove(test_support.TESTFN)
-            os.mkdir(test_support.TESTFN)
-            self.assertIs(genericpath.isdir(test_support.TESTFN), True)
-            os.rmdir(test_support.TESTFN)
+            self.assertIs(genericpath.isdir(support.TESTFN), False)
+            os.remove(support.TESTFN)
+            os.mkdir(support.TESTFN)
+            self.assertIs(genericpath.isdir(support.TESTFN), True)
+            os.rmdir(support.TESTFN)
         finally:
             if not f.close():
                 f.close()
             try:
-                os.remove(test_support.TESTFN)
+                os.remove(support.TESTFN)
             except os.error:
                 pass
             try:
-                os.rmdir(test_support.TESTFN)
+                os.rmdir(support.TESTFN)
             except os.error:
                 pass
 
         self.assertRaises(TypeError, genericpath.isdir)
 
     def test_isfile(self):
-        self.assertIs(genericpath.isfile(test_support.TESTFN), False)
-        f = open(test_support.TESTFN, "wb")
+        self.assertIs(genericpath.isfile(support.TESTFN), False)
+        f = open(support.TESTFN, "wb")
         try:
             f.write(b"foo")
             f.close()
-            self.assertIs(genericpath.isfile(test_support.TESTFN), True)
-            os.remove(test_support.TESTFN)
-            os.mkdir(test_support.TESTFN)
-            self.assertIs(genericpath.isfile(test_support.TESTFN), False)
-            os.rmdir(test_support.TESTFN)
+            self.assertIs(genericpath.isfile(support.TESTFN), True)
+            os.remove(support.TESTFN)
+            os.mkdir(support.TESTFN)
+            self.assertIs(genericpath.isfile(support.TESTFN), False)
+            os.rmdir(support.TESTFN)
         finally:
             if not f.close():
                 f.close()
             try:
-                os.remove(test_support.TESTFN)
+                os.remove(support.TESTFN)
             except os.error:
                 pass
             try:
-                os.rmdir(test_support.TESTFN)
+                os.rmdir(support.TESTFN)
             except os.error:
                 pass
 
         self.assertRaises(TypeError, genericpath.isdir)
 
         def test_samefile(self):
-            f = open(test_support.TESTFN + "1", "wb")
+            f = open(support.TESTFN + "1", "wb")
             try:
                 f.write(b"foo")
                 f.close()
                 self.assertIs(
                     genericpath.samefile(
-                        test_support.TESTFN + "1",
-                        test_support.TESTFN + "1"
+                        support.TESTFN + "1",
+                        support.TESTFN + "1"
                     ),
                     True
                 )
@@ -142,24 +142,24 @@ class AllCommonTest(unittest.TestCase):
                 # inode information and thus, that samefile() doesn't work
                 if hasattr(os, "symlink"):
                     os.symlink(
-                        test_support.TESTFN + "1",
-                        test_support.TESTFN + "2"
+                        support.TESTFN + "1",
+                        support.TESTFN + "2"
                     )
                     self.assertIs(
                         genericpath.samefile(
-                            test_support.TESTFN + "1",
-                            test_support.TESTFN + "2"
+                            support.TESTFN + "1",
+                            support.TESTFN + "2"
                         ),
                         True
                     )
-                    os.remove(test_support.TESTFN + "2")
-                    f = open(test_support.TESTFN + "2", "wb")
+                    os.remove(support.TESTFN + "2")
+                    f = open(support.TESTFN + "2", "wb")
                     f.write(b"bar")
                     f.close()
                     self.assertIs(
                         genericpath.samefile(
-                            test_support.TESTFN + "1",
-                            test_support.TESTFN + "2"
+                            support.TESTFN + "1",
+                            support.TESTFN + "2"
                         ),
                         False
                     )
@@ -167,18 +167,18 @@ class AllCommonTest(unittest.TestCase):
                 if not f.close():
                     f.close()
                 try:
-                    os.remove(test_support.TESTFN + "1")
+                    os.remove(support.TESTFN + "1")
                 except os.error:
                     pass
                 try:
-                    os.remove(test_support.TESTFN + "2")
+                    os.remove(support.TESTFN + "2")
                 except os.error:
                     pass
 
             self.assertRaises(TypeError, genericpath.samefile)
 
 def test_main():
-    test_support.run_unittest(AllCommonTest)
+    support.run_unittest(AllCommonTest)
 
 if __name__=="__main__":
     test_main()
index 593c1c5b578d3313f435a6f4253d970b6a73aff9..61e9fe5e70a195f46cfae1a425e3f5b9430a04da 100644 (file)
@@ -262,16 +262,16 @@ __test__ = {'doctests' : doctests}
 
 def test_main(verbose=None):
     import sys
-    from test import test_support
+    from test import support
     from test import test_genexps
-    test_support.run_doctest(test_genexps, verbose)
+    support.run_doctest(test_genexps, verbose)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_doctest(test_genexps, verbose)
+            support.run_doctest(test_genexps, verbose)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
index 69791e8d7d03a5d0cd7057bca92bf1a335102360..34d8ee03bc6e798e7baa07d9eac67be52028f47d 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 from _testcapi import getargs_keywords
 
 import warnings
@@ -306,7 +306,7 @@ def test_main():
         pass # PY_LONG_LONG not available
     else:
         tests.append(LongLong_TestCase)
-    test_support.run_unittest(*tests)
+    support.run_unittest(*tests)
 
 if __name__ == "__main__":
     test_main()
index 36d1688b03f6425ddb52e69c477d5c3b2cd0479a..de3325d7ee964c9b3bdf95ed47a4844de6e3ca78 100644 (file)
@@ -1,7 +1,7 @@
 # test_getopt.py
 # David Goodger <dgoodger@bigfoot.com> 2000-08-19
 
-from test.test_support import verbose, run_doctest, run_unittest
+from test.support import verbose, run_doctest, run_unittest
 import unittest
 
 import getopt
index a875272bd3e28d26bac60eda7b7941cfd39228ac..73c9c1c146b18c2f77a833e495a0e21fe4cb36ee 100644 (file)
@@ -4,7 +4,7 @@ import shutil
 import gettext
 import unittest
 
-from test import test_support
+from test import support
 
 
 # TODO:
@@ -338,7 +338,7 @@ class WeirdMetadataTest(GettextBaseTest):
 
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == '__main__':
     test_main()
index a628e6e4b24301a72de1418d3f7f223431eedc6b..adaea189fbadee2bf8b8ec4bae93fae9f233d382 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test.test_support import run_unittest, TESTFN
+from test.support import run_unittest, TESTFN
 import glob
 import os
 import shutil
index 2a58a10a22ac324fdd0ab1a4cd8ff9b700b93c02..823f2c544d21adfeea8d26f81c3e86144a7d0c83 100644 (file)
@@ -1,6 +1,6 @@
 """Verify that warnings are issued for global statements following use."""
 
-from test.test_support import run_unittest, check_syntax_error
+from test.support import run_unittest, check_syntax_error
 import unittest
 
 import warnings
index 94b7b312bc76eef0226d41defa0e7ba0e9defc5b..1a34ff8b74dd96d894d92a3a0f43472bbf5a0b60 100644 (file)
@@ -8,7 +8,7 @@
 # regression test, the filterwarnings() call has been added to
 # regrtest.py.
 
-from test.test_support import run_unittest, check_syntax_error
+from test.support import run_unittest, check_syntax_error
 import unittest
 import sys
 # testing import *
index fb607f003f087c5f49125b1555be322a2a914e83..5acda52e9a6349f9478599cd1e93bdce258ef443 100755 (executable)
@@ -2,7 +2,7 @@
 
 import grp
 import unittest
-from test import test_support
+from test import support
 
 class GroupDatabaseTestCase(unittest.TestCase):
 
@@ -86,7 +86,7 @@ class GroupDatabaseTestCase(unittest.TestCase):
         self.assertRaises(KeyError, grp.getgrgid, fakegid)
 
 def test_main():
-    test_support.run_unittest(GroupDatabaseTestCase)
+    support.run_unittest(GroupDatabaseTestCase)
 
 if __name__ == "__main__":
     test_main()
index 0010112a8b28b64688099cc8d79ea551a56c9b57..c26035bae793a7140f60e376773d900984c3a22d 100644 (file)
@@ -3,7 +3,7 @@
 """
 
 import unittest
-from test import test_support
+from test import support
 import os
 import gzip
 
@@ -22,13 +22,13 @@ data2 = b"""/* zlibmodule.c -- gzip-compatible data compression */
 
 
 class TestGzip(unittest.TestCase):
-    filename = test_support.TESTFN
+    filename = support.TESTFN
 
     def setUp (self):
-        test_support.unlink(self.filename)
+        support.unlink(self.filename)
 
     def tearDown (self):
-        test_support.unlink(self.filename)
+        support.unlink(self.filename)
 
 
     def test_write (self):
@@ -158,7 +158,7 @@ class TestGzip(unittest.TestCase):
             f.close()
 
 def test_main(verbose=None):
-    test_support.run_unittest(TestGzip)
+    support.run_unittest(TestGzip)
 
 if __name__ == "__main__":
     test_main(verbose=True)
index a0364f2a30783b13d82e2b7d2f7191578221cc76..fb1699a13220570856f38f64bc85d6ff673d1eb1 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 import unittest
-from test import test_support
+from test import support
 
 
 class HashEqualityTestCase(unittest.TestCase):
@@ -38,7 +38,7 @@ class HashEqualityTestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(HashEqualityTestCase)
+    support.run_unittest(HashEqualityTestCase)
 
 
 if __name__ == "__main__":
index 399e50b16232df79d6c263b9fb0f948df020af2c..912b1334c982ea39408662984c149370381fda78 100644 (file)
@@ -8,7 +8,7 @@
 
 import hashlib
 import unittest
-from test import test_support
+from test import support
 
 
 def hexstr(s):
@@ -186,7 +186,7 @@ class HashLibTestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(HashLibTestCase)
+    support.run_unittest(HashLibTestCase)
 
 
 if __name__ == "__main__":
index 24d2992479b82189791d14fcb1cd4ee90528ab85..e41abf023cd0d0e3be4db0be25d4fbd296ed3969 100644 (file)
@@ -2,7 +2,7 @@
 
 import random
 import unittest
-from test import test_support
+from test import support
 import sys
 
 # We do a bit of trickery here to be able to test both the C implementation
@@ -353,14 +353,14 @@ def test_main(verbose=None):
     from types import BuiltinFunctionType
 
     test_classes = [TestHeapPython, TestHeapC, TestErrorHandling]
-    test_support.run_unittest(*test_classes)
+    support.run_unittest(*test_classes)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_unittest(*test_classes)
+            support.run_unittest(*test_classes)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
index 537f29854a905e24370c60b8fcf2dfee56bd4d24..43953cfeb04e08e4a6478aab1a5e3b7a12b5f29b 100644 (file)
@@ -2,7 +2,7 @@ import hmac
 import hashlib
 import unittest
 import warnings
-from test import test_support
+from test import support
 
 class TestVectorsTestCase(unittest.TestCase):
 
@@ -211,7 +211,7 @@ class TestVectorsTestCase(unittest.TestCase):
             def digest(self):
                 return self._x.digest()
 
-        with test_support.catch_warning():
+        with support.catch_warning():
             warnings.simplefilter('error', RuntimeWarning)
             try:
                 hmac.HMAC(b'a', b'b', digestmod=MockCrazyHash)
@@ -309,7 +309,7 @@ class CopyTestCase(unittest.TestCase):
             "Hexdigest of copy doesn't match original hexdigest.")
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         TestVectorsTestCase,
         ConstructorTestCase,
         SanityTestCase,
index a20f43bbf1146c90a7316f84081672ea77a5fe2c..61f3a139a9decc9fb04146527fe07b8d20920d0e 100644 (file)
@@ -2,7 +2,7 @@ import formatter
 import htmllib
 import unittest
 
-from test import test_support
+from test import support
 
 
 class AnchorCollector(htmllib.HTMLParser):
@@ -62,7 +62,7 @@ class HTMLParserTestCase(unittest.TestCase):
                            ])
 
 def test_main():
-    test_support.run_unittest(HTMLParserTestCase)
+    support.run_unittest(HTMLParserTestCase)
 
 
 if __name__ == "__main__":
index a4f2c34c6cefa448045af21e5992f96eef6bcb6f..8691cbf826a8d62712527419ea589852160191d0 100755 (executable)
@@ -3,7 +3,7 @@
 import HTMLParser
 import pprint
 import unittest
-from test import test_support
+from test import support
 
 
 class EventCollector(HTMLParser.HTMLParser):
@@ -315,7 +315,7 @@ DOCTYPE html [
 
 
 def test_main():
-    test_support.run_unittest(HTMLParserTestCase)
+    support.run_unittest(HTMLParserTestCase)
 
 
 if __name__ == "__main__":
index f0e551f5eb3ace43ab982b4d82ccf65347033f34..7a77cffde41b4ff211800efdbecad03bba3ac36f 100644 (file)
@@ -4,9 +4,9 @@ import socket
 
 from unittest import TestCase
 
-from test import test_support
+from test import support
 
-HOST = test_support.HOST
+HOST = support.HOST
 
 class FakeSocket:
     def __init__(self, text, fileclass=io.BytesIO):
@@ -206,7 +206,7 @@ class TimeoutTest(TestCase):
 
     def setUp(self):
         self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-        TimeoutTest.PORT = test_support.bind_port(self.serv)
+        TimeoutTest.PORT = support.bind_port(self.serv)
         self.serv.listen(5)
 
     def tearDown(self):
@@ -252,7 +252,7 @@ class HTTPSTimeoutTest(TestCase):
             self.assertEqual(h.timeout, 30)
 
 def test_main(verbose=None):
-    test_support.run_unittest(HeaderTests, OfflineTest, BasicTest, TimeoutTest,
+    support.run_unittest(HeaderTests, OfflineTest, BasicTest, TimeoutTest,
                               HTTPSTimeoutTest)
 
 if __name__ == '__main__':
index ce0e0752946409549d6c3aed99e35932ec15de03..2105fc2dcfa3f9936f154067b35c4e4fea893938 100644 (file)
@@ -1,7 +1,7 @@
 import imaplib
 import time
 
-from test import test_support
+from test import support
 import unittest
 
 
@@ -18,7 +18,7 @@ class TestImaplib(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(TestImaplib)
+    support.run_unittest(TestImaplib)
 
 
 if __name__ == "__main__":
index 13a3bfd713723cf1faf4640bc3cc963817a7614d..e2b9e9ab245ddcba4a09c9d0cc9f4dafcb9fc84c 100644 (file)
@@ -1,6 +1,6 @@
 import imp
 import unittest
-from test import test_support
+from test import support
 
 
 class LockTests(unittest.TestCase):
@@ -69,7 +69,7 @@ class ImportTests(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
                 LockTests,
                 ImportTests,
             )
index 1c9dd3a026c9f442dc8cb6941c03479412036b63..81e221dd7350528ca3d93d550d46680fd01d0e2a 100644 (file)
@@ -1,4 +1,4 @@
-from test.test_support import TESTFN, run_unittest, catch_warning
+from test.support import TESTFN, run_unittest, catch_warning
 
 import unittest
 import os
@@ -8,7 +8,7 @@ import sys
 import py_compile
 import warnings
 import imp
-from test.test_support import unlink, TESTFN, unload
+from test.support import unlink, TESTFN, unload
 
 
 def remove_files(name):
@@ -146,13 +146,13 @@ class ImportTest(unittest.TestCase):
     def test_import_name_binding(self):
         # import x.y.z binds x in the current namespace
         import test as x
-        import test.test_support
+        import test.support
         self.assert_(x is test, x.__name__)
-        self.assert_(hasattr(test.test_support, "__file__"))
+        self.assert_(hasattr(test.support, "__file__"))
 
         # import x.y.z as w binds z as w
-        import test.test_support as y
-        self.assert_(y is test.test_support, y.__name__)
+        import test.support as y
+        self.assert_(y is test.support, y.__name__)
 
     def test_import_initless_directory_warning(self):
         with catch_warning():
index 3108bd6d25a87e2884de661dd09886815374fc36..eaf213d0c04d0736cba8def5e0c1fb37967f97c8 100644 (file)
@@ -2,7 +2,7 @@ import sys
 import imp
 import os
 import unittest
-from test import test_support
+from test import support
 
 
 test_src = """\
@@ -265,7 +265,7 @@ class ImportHooksTestCase(ImportHooksBaseTestCase):
             pass
 
 def test_main():
-    test_support.run_unittest(ImportHooksTestCase)
+    support.run_unittest(ImportHooksTestCase)
 
 if __name__ == "__main__":
     test_main()
index 71cfb15c0f10ad337fe9eb4564a9a3b752a275eb..31609c3107970bea6dd054d76b5156261f100dcb 100644 (file)
@@ -1,7 +1,7 @@
 import unittest
-from test import test_support
+from test import support
 import operator
-maxsize = test_support.MAX_Py_ssize_t
+maxsize = support.MAX_Py_ssize_t
 minsize = -maxsize-1
 
 class oldstyle:
@@ -193,7 +193,7 @@ class OverflowTestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         BaseTestCase,
         ListTestCase,
         TupleTestCase,
index c62fa552d8caf7a2365bfd90e595a632426a233d..55fae207344d91e16a49ec3e359c1dc0f44a72c9 100644 (file)
@@ -6,7 +6,7 @@ import datetime
 import collections
 from os.path import normcase
 
-from test.test_support import TESTFN, run_unittest
+from test.support import TESTFN, run_unittest
 
 from test import inspect_fodder as mod
 from test import inspect_fodder2 as mod2
index 91d52735bdf0187a2370f716ace0ceca884a115c..3462540e7563868767e2c1e6c9d3df0224077a25 100644 (file)
@@ -1,7 +1,7 @@
 import sys
 
 import unittest
-from test.test_support import run_unittest
+from test.support import run_unittest
 
 L = [
         ('0', 0),
index 9bd0c412ce9481425519ca19c3641a5856baab92..1d578a7d716304899dbc7b605ab852dbe9c2b4a3 100644 (file)
@@ -4,7 +4,7 @@ This is complex because of changes due to PEP 237.
 """
 
 import unittest
-from test import test_support
+from test import support
 
 class TestHexOctBin(unittest.TestCase):
 
@@ -141,7 +141,7 @@ class TestHexOctBin(unittest.TestCase):
         self.assertEqual(-0b1111111111111111111111111111111111111111111111111111111111111111, -18446744073709551615)
 
 def test_main():
-    test_support.run_unittest(TestHexOctBin)
+    support.run_unittest(TestHexOctBin)
 
 if __name__ == "__main__":
     test_main()
index fa3a8bbfd604d6ecd1b5338dd9ddacd302348f3f..320c7c3c6d3d7e6f836f2a12ffb8065f692a1af4 100644 (file)
@@ -6,7 +6,7 @@ import time
 import array
 import unittest
 from itertools import chain
-from test import test_support
+from test import support
 
 import codecs
 import io  # The module under test
@@ -80,10 +80,10 @@ class MockNonBlockWriterIO(io.RawIOBase):
 class IOTest(unittest.TestCase):
 
     def setUp(self):
-        test_support.unlink(test_support.TESTFN)
+        support.unlink(support.TESTFN)
 
     def tearDown(self):
-        test_support.unlink(test_support.TESTFN)
+        support.unlink(support.TESTFN)
 
     def write_ops(self, f):
         self.assertEqual(f.write(b"blah."), 5)
@@ -149,13 +149,13 @@ class IOTest(unittest.TestCase):
         self.assertEqual(f.read(2), b"x")
 
     def test_raw_file_io(self):
-        f = io.open(test_support.TESTFN, "wb", buffering=0)
+        f = io.open(support.TESTFN, "wb", buffering=0)
         self.assertEqual(f.readable(), False)
         self.assertEqual(f.writable(), True)
         self.assertEqual(f.seekable(), True)
         self.write_ops(f)
         f.close()
-        f = io.open(test_support.TESTFN, "rb", buffering=0)
+        f = io.open(support.TESTFN, "rb", buffering=0)
         self.assertEqual(f.readable(), True)
         self.assertEqual(f.writable(), False)
         self.assertEqual(f.seekable(), True)
@@ -163,13 +163,13 @@ class IOTest(unittest.TestCase):
         f.close()
 
     def test_buffered_file_io(self):
-        f = io.open(test_support.TESTFN, "wb")
+        f = io.open(support.TESTFN, "wb")
         self.assertEqual(f.readable(), False)
         self.assertEqual(f.writable(), True)
         self.assertEqual(f.seekable(), True)
         self.write_ops(f)
         f.close()
-        f = io.open(test_support.TESTFN, "rb")
+        f = io.open(support.TESTFN, "rb")
         self.assertEqual(f.readable(), True)
         self.assertEqual(f.writable(), False)
         self.assertEqual(f.seekable(), True)
@@ -177,10 +177,10 @@ class IOTest(unittest.TestCase):
         f.close()
 
     def test_readline(self):
-        f = io.open(test_support.TESTFN, "wb")
+        f = io.open(support.TESTFN, "wb")
         f.write(b"abc\ndef\nxyzzy\nfoo")
         f.close()
-        f = io.open(test_support.TESTFN, "rb")
+        f = io.open(support.TESTFN, "rb")
         self.assertEqual(f.readline(), b"abc\n")
         self.assertEqual(f.readline(10), b"def\n")
         self.assertEqual(f.readline(2), b"xy")
@@ -201,7 +201,7 @@ class IOTest(unittest.TestCase):
         # a long time to build the >2GB file and takes >2GB of disk space
         # therefore the resource must be enabled to run this test.
         if sys.platform[:3] == 'win' or sys.platform == 'darwin':
-            if not test_support.is_resource_enabled("largefile"):
+            if not support.is_resource_enabled("largefile"):
                 print("\nTesting large file ops skipped on %s." % sys.platform,
                       file=sys.stderr)
                 print("It requires %d bytes and a long time." % self.LARGE,
@@ -209,22 +209,22 @@ class IOTest(unittest.TestCase):
                 print("Use 'regrtest.py -u largefile test_io' to run it.",
                       file=sys.stderr)
                 return
-        f = io.open(test_support.TESTFN, "w+b", 0)
+        f = io.open(support.TESTFN, "w+b", 0)
         self.large_file_ops(f)
         f.close()
-        f = io.open(test_support.TESTFN, "w+b")
+        f = io.open(support.TESTFN, "w+b")
         self.large_file_ops(f)
         f.close()
 
     def test_with_open(self):
         for bufsize in (0, 1, 100):
             f = None
-            with open(test_support.TESTFN, "wb", bufsize) as f:
+            with open(support.TESTFN, "wb", bufsize) as f:
                 f.write(b"xxx")
             self.assertEqual(f.closed, True)
             f = None
             try:
-                with open(test_support.TESTFN, "wb", bufsize) as f:
+                with open(support.TESTFN, "wb", bufsize) as f:
                     1/0
             except ZeroDivisionError:
                 self.assertEqual(f.closed, True)
@@ -243,31 +243,31 @@ class IOTest(unittest.TestCase):
             def flush(self):
                 record.append(3)
                 io.FileIO.flush(self)
-        f = MyFileIO(test_support.TESTFN, "w")
+        f = MyFileIO(support.TESTFN, "w")
         f.write("xxx")
         del f
         self.assertEqual(record, [1, 2, 3])
 
     def test_close_flushes(self):
-        f = io.open(test_support.TESTFN, "wb")
+        f = io.open(support.TESTFN, "wb")
         f.write(b"xxx")
         f.close()
-        f = io.open(test_support.TESTFN, "rb")
+        f = io.open(support.TESTFN, "rb")
         self.assertEqual(f.read(), b"xxx")
         f.close()
 
     def test_array_writes(self):
         a = array.array('i', range(10))
         n = len(memoryview(a))
-        f = io.open(test_support.TESTFN, "wb", 0)
+        f = io.open(support.TESTFN, "wb", 0)
         self.assertEqual(f.write(a), n)
         f.close()
-        f = io.open(test_support.TESTFN, "wb")
+        f = io.open(support.TESTFN, "wb")
         self.assertEqual(f.write(a), n)
         f.close()
 
     def test_closefd(self):
-        self.assertRaises(ValueError, io.open, test_support.TESTFN, 'w',
+        self.assertRaises(ValueError, io.open, support.TESTFN, 'w',
                           closefd=False)
 
 class MemorySeekTestMixin:
@@ -638,10 +638,10 @@ class TextIOWrapperTest(unittest.TestCase):
     def setUp(self):
         self.testdata = b"AAA\r\nBBB\rCCC\r\nDDD\nEEE\r\n"
         self.normalized = b"AAA\nBBB\nCCC\nDDD\nEEE\n".decode("ascii")
-        test_support.unlink(test_support.TESTFN)
+        support.unlink(support.TESTFN)
 
     def tearDown(self):
-        test_support.unlink(test_support.TESTFN)
+        support.unlink(support.TESTFN)
 
     def testLineBuffering(self):
         r = io.BytesIO()
@@ -818,11 +818,11 @@ class TextIOWrapperTest(unittest.TestCase):
     def testBasicIO(self):
         for chunksize in (1, 2, 3, 4, 5, 15, 16, 17, 31, 32, 33, 63, 64, 65):
             for enc in "ascii", "latin1", "utf8" :# , "utf-16-be", "utf-16-le":
-                f = io.open(test_support.TESTFN, "w+", encoding=enc)
+                f = io.open(support.TESTFN, "w+", encoding=enc)
                 f._CHUNK_SIZE = chunksize
                 self.assertEquals(f.write("abc"), 3)
                 f.close()
-                f = io.open(test_support.TESTFN, "r+", encoding=enc)
+                f = io.open(support.TESTFN, "r+", encoding=enc)
                 f._CHUNK_SIZE = chunksize
                 self.assertEquals(f.tell(), 0)
                 self.assertEquals(f.read(), "abc")
@@ -865,7 +865,7 @@ class TextIOWrapperTest(unittest.TestCase):
         self.assertEquals(rlines, wlines)
 
     def testTelling(self):
-        f = io.open(test_support.TESTFN, "w+", encoding="utf8")
+        f = io.open(support.TESTFN, "w+", encoding="utf8")
         p0 = f.tell()
         f.write("\xff\n")
         p1 = f.tell()
@@ -893,10 +893,10 @@ class TextIOWrapperTest(unittest.TestCase):
         u_suffix = "\u8888\n"
         suffix = bytes(u_suffix.encode("utf-8"))
         line = prefix + suffix
-        f = io.open(test_support.TESTFN, "wb")
+        f = io.open(support.TESTFN, "wb")
         f.write(line*2)
         f.close()
-        f = io.open(test_support.TESTFN, "r", encoding="utf-8")
+        f = io.open(support.TESTFN, "r", encoding="utf-8")
         s = f.read(prefix_size)
         self.assertEquals(s, str(prefix, "ascii"))
         self.assertEquals(f.tell(), prefix_size)
@@ -905,10 +905,10 @@ class TextIOWrapperTest(unittest.TestCase):
     def testSeekingToo(self):
         # Regression test for a specific bug
         data = b'\xe0\xbf\xbf\n'
-        f = io.open(test_support.TESTFN, "wb")
+        f = io.open(support.TESTFN, "wb")
         f.write(data)
         f.close()
-        f = io.open(test_support.TESTFN, "r", encoding="utf-8")
+        f = io.open(support.TESTFN, "r", encoding="utf-8")
         f._CHUNK_SIZE  # Just test that it exists
         f._CHUNK_SIZE = 2
         f.readline()
@@ -920,16 +920,16 @@ class TextIOWrapperTest(unittest.TestCase):
         def testSeekAndTellWithData(data, min_pos=0):
             """Tell/seek to various points within a data stream and ensure
             that the decoded data returned by read() is consistent."""
-            f = io.open(test_support.TESTFN, 'wb')
+            f = io.open(support.TESTFN, 'wb')
             f.write(data)
             f.close()
-            f = io.open(test_support.TESTFN, encoding='test_decoder')
+            f = io.open(support.TESTFN, encoding='test_decoder')
             decoded = f.read()
             f.close()
 
             for i in range(min_pos, len(decoded) + 1): # seek positions
                 for j in [1, 5, len(decoded) - i]: # read lengths
-                    f = io.open(test_support.TESTFN, encoding='test_decoder')
+                    f = io.open(support.TESTFN, encoding='test_decoder')
                     self.assertEquals(f.read(i), decoded[:i])
                     cookie = f.tell()
                     self.assertEquals(f.read(j), decoded[i:i + j])
@@ -985,7 +985,7 @@ class TextIOWrapperTest(unittest.TestCase):
         nchars = len(line)
         nbytes = len(line.encode(enc))
         for chunk_size in (32, 64, 128, 256):
-            f = io.open(test_support.TESTFN, "w+", encoding=enc)
+            f = io.open(support.TESTFN, "w+", encoding=enc)
             f._CHUNK_SIZE = chunk_size
             t0 = timer()
             for i in range(nlines):
@@ -1005,7 +1005,7 @@ class TextIOWrapperTest(unittest.TestCase):
                 f.tell()
             t4 = timer()
             f.close()
-            if test_support.verbose:
+            if support.verbose:
                 print("\nTiming test: %d lines of %d characters (%d bytes)" %
                       (nlines, nchars, nbytes))
                 print("File chunk size:          %6s" % f._CHUNK_SIZE)
@@ -1162,7 +1162,7 @@ class MiscIOTest(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(IOTest, BytesIOTest, StringIOTest,
+    support.run_unittest(IOTest, BytesIOTest, StringIOTest,
                               BufferedReaderTest, BufferedWriterTest,
                               BufferedRWPairTest, BufferedRandomTest,
                               StatefulIncrementalDecoderTest,
index feea5bf4f691e9cf9d7a2c53f3f44cb31b94f754..e9c1d0f5d4880fb75e544b657393371156b6effe 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test.test_support import TestSkipped, run_unittest
+from test.support import TestSkipped, run_unittest
 import os, struct
 try:
     import fcntl, termios
index 1e29f4c7ef1d2b94961f90627d04979adcb9e8f3..9482e754386eb003f5c2dec95ea56526528a14ea 100644 (file)
@@ -3,7 +3,7 @@
 # testing of error conditions uncovered when using extension types.
 
 import unittest
-from test import test_support
+from test import support
 import sys
 
 
@@ -264,7 +264,7 @@ def blowstack(fxn, arg, compare_to):
 
 \f
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         TestIsInstanceExceptions,
         TestIsSubclassExceptions,
         TestIsInstanceIsSubclass
index d861dcdd66d55d9897f7ff2ff823850523ee5fcf..eba9728e34d037ecc3644db47c8fec3f0d591edd 100644 (file)
@@ -1,7 +1,7 @@
 # Test iterators.
 
 import unittest
-from test.test_support import run_unittest, TESTFN, unlink
+from test.support import run_unittest, TESTFN, unlink
 
 # Test result of triple loop (too big to inline)
 TRIPLETS = [(0, 0, 0), (0, 0, 1), (0, 0, 2),
index 46aefaa3352f70ab8256efaa394692abe384e89d..72e92a580130e0b4cf17ec21c8df67a31af302d9 100644 (file)
@@ -42,7 +42,7 @@ enumerate(iter('abc')).
 """
 
 import unittest
-from test import test_support
+from test import support
 from itertools import repeat
 from collections import deque
 from builtins import len as _len
@@ -211,7 +211,7 @@ def test_main():
         TestList,
         TestListReversed,
     ]
-    test_support.run_unittest(*unittests)
+    support.run_unittest(*unittests)
 
 if __name__ == "__main__":
     test_main()
index 335e47ddc0da88d347d4e44cf93273ce1f8934fd..3957f4192d2b798f9b326a24213683b57e1d1fc5 100644 (file)
@@ -1,12 +1,12 @@
 import unittest
-from test import test_support
+from test import support
 from itertools import *
 from weakref import proxy
 import sys
 import operator
 import random
 from functools import reduce
-maxsize = test_support.MAX_Py_ssize_t
+maxsize = support.MAX_Py_ssize_t
 minsize = -maxsize-1
 
 def lzip(*args):
@@ -1391,20 +1391,20 @@ def test_main(verbose=None):
     test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC,
                     RegressionTests, LengthTransparency,
                     SubclassWithKwargsTest, TestExamples)
-    test_support.run_unittest(*test_classes)
+    support.run_unittest(*test_classes)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_unittest(*test_classes)
+            support.run_unittest(*test_classes)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
 
     # doctest the examples in the library reference
-    test_support.run_doctest(sys.modules[__name__], verbose)
+    support.run_doctest(sys.modules[__name__], verbose)
 
 if __name__ == "__main__":
     test_main(verbose=True)
index 17ccdeecc45a781541d3be8fd6a48147384f24de..17e1daf3607484d793bf8d2ba966a8073337dbff 100644 (file)
@@ -6,12 +6,12 @@ be run.
 """
 
 import json.tests
-import test.test_support
+import test.support
 
 
 def test_main():
-    test.test_support.run_unittest(json.tests.test_suite())
-    test.test_support.run_doctest(json)
+    test.support.run_unittest(json.tests.test_suite())
+    test.support.run_doctest(json)
 
 
 if __name__ == "__main__":
index e64a6cdd7ca1836fba3c43d06035622da2264059..aa7d3db8946365ccbaee7a9c5ac25a68e9b27639 100644 (file)
@@ -6,7 +6,7 @@ __author__ = "Jiwon Seo"
 __email__ = "seojiwon at gmail dot com"
 
 import unittest
-from test.test_support import run_unittest
+from test.support import run_unittest
 
 def posonly_sum(pos_arg1, *arg, **kwarg):
     return pos_arg1 + sum(arg) + sum(kwarg.values())
index 310eb339623486848a145f0de1646bfd907b1848..ef4363301d634c994ae3239b5338f7fa2d8c7f73 100644 (file)
@@ -8,9 +8,9 @@ import select
 import sys
 import unittest
 
-from test import test_support
+from test import support
 if not hasattr(select, "kqueue"):
-    raise test_support.TestSkipped("test works only on BSD")
+    raise support.TestSkipped("test works only on BSD")
 
 class TestKQueue(unittest.TestCase):
     def test_create_queue(self):
@@ -160,7 +160,7 @@ class TestKQueue(unittest.TestCase):
         serverSocket.close()
 
 def test_main():
-    test_support.run_unittest(TestKQueue)
+    support.run_unittest(TestKQueue)
 
 if __name__ == "__main__":
     test_main()
index 0856346ffcc7e363c208cc75c181eb0cc61d9391..8060ea04e85526ac4cfcf9fed10a74182a7ce01b 100644 (file)
@@ -5,7 +5,7 @@ import os
 import stat
 import sys
 import unittest
-from test.test_support import run_unittest, TESTFN, verbose, requires, \
+from test.support import run_unittest, TESTFN, verbose, requires, \
                               TestSkipped, unlink
 
 try:
index 161b9ddd242eb68a115969bd8f3a0d7776495068..9bd4496726a1c5d3ea6bece232ea856ca71e94e1 100644 (file)
@@ -2,7 +2,7 @@
 # because of running
 from lib2to3.tests import test_fixers, test_pytree, test_util
 import unittest
-from test.test_support import run_unittest
+from test.support import run_unittest
 
 def suite():
     tests = unittest.TestSuite()
index 3b851176d4da307513e0f436ddcf2ec88ff9c9ad..5184321771892aa8257136161092ee07f48300a5 100644 (file)
@@ -1,5 +1,5 @@
 import sys
-from test import test_support, list_tests
+from test import support, list_tests
 
 class ListTest(list_tests.CommonTest):
     type2test = list
@@ -43,7 +43,7 @@ class ListTest(list_tests.CommonTest):
         self.assertRaises((MemoryError, OverflowError), imul, lst, n)
 
 def test_main(verbose=None):
-    test_support.run_unittest(ListTest)
+    support.run_unittest(ListTest)
 
     # verify reference counting
     import sys
@@ -51,7 +51,7 @@ def test_main(verbose=None):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_unittest(ListTest)
+            support.run_unittest(ListTest)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
index 684b7161835fbf9ef5d86f9814828951024b4d3f..663ccbbe194f0a1764d25432620de343b4b0d7fa 100644 (file)
@@ -130,16 +130,16 @@ __test__ = {'doctests' : doctests}
 
 def test_main(verbose=None):
     import sys
-    from test import test_support
+    from test import support
     from test import test_listcomps
-    test_support.run_doctest(test_listcomps, verbose)
+    support.run_doctest(test_listcomps, verbose)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_doctest(test_genexps, verbose)
+            support.run_doctest(test_genexps, verbose)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
@@ -278,16 +278,16 @@ __test__ = {'doctests' : doctests}
 
 def test_main(verbose=None):
     import sys
-    from test import test_support
+    from test import support
     from test import test_listcomps
-    test_support.run_doctest(test_listcomps, verbose)
+    support.run_doctest(test_listcomps, verbose)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_doctest(test_genexps, verbose)
+            support.run_doctest(test_genexps, verbose)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
@@ -426,16 +426,16 @@ __test__ = {'doctests' : doctests}
 
 def test_main(verbose=None):
     import sys
-    from test import test_support
+    from test import support
     from test import test_listcomps
-    test_support.run_doctest(test_listcomps, verbose)
+    support.run_doctest(test_listcomps, verbose)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_doctest(test_listcomps, verbose)
+            support.run_doctest(test_listcomps, verbose)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
index ef1f5c201e95cac9869427c1a3ce5f3047ccc815..6d130581d221841a2571d103620e2d2ddffb0c61 100644 (file)
@@ -1,4 +1,4 @@
-from test.test_support import verbose, TestSkipped
+from test.support import verbose, TestSkipped
 import locale
 import sys
 
index b6da0aeff4d537294674b98e81930522fb8e37da..888ac72d7383d793a16a8a533af045c7c51a764a 100644 (file)
@@ -38,7 +38,7 @@ import string
 import struct
 import sys
 import tempfile
-from test.test_support import captured_stdout, run_with_locale, run_unittest
+from test.support import captured_stdout, run_with_locale, run_unittest
 import textwrap
 import threading
 import time
index 256a1ce1be16e6a29c8d328a5a4dd5a4bad7ec16..21881c97c9f9e8cf9601d40a62b0f2411fc93925 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 import sys
 
 import random
@@ -771,7 +771,7 @@ class LongTest(unittest.TestCase):
         self.assertRaises(OverflowError, int, float('nan'))
 
 def test_main():
-    test_support.run_unittest(LongTest)
+    support.run_unittest(LongTest)
 
 if __name__ == "__main__":
     test_main()
index 36840b4dd6ba830adeb362ae26b5aedaff694c4a..428b03aeb492574446dd34186f595a029cc6b3c5 100644 (file)
@@ -4,7 +4,7 @@ from __future__ import division
 # trick just part of test_long into using future division.
 
 import unittest
-from test.test_support import run_unittest
+from test.support import run_unittest
 
 class TrueDivisionTests(unittest.TestCase):
     def test(self):
index dd222a19bff300bb8d9fb9537f707ccda4068e86..1b40d0298318916c639a13c7092f58cb7de744e1 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 
 class LongExpText(unittest.TestCase):
     def test_longexp(self):
@@ -8,7 +8,7 @@ class LongExpText(unittest.TestCase):
         self.assertEqual(len(l), REPS)
 
 def test_main():
-    test_support.run_unittest(LongExpText)
+    support.run_unittest(LongExpText)
 
 if __name__=="__main__":
     test_main()
index 9d363758c8dd355a01f741dbbe6849f50e3f27db..38b85e5bdca579efbddd833bfa442ea9ee7107dd 100644 (file)
@@ -1,5 +1,5 @@
 import macpath
-from test import test_support
+from test import support
 import unittest
 
 
@@ -56,7 +56,7 @@ class MacPathTestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(MacPathTestCase)
+    support.run_unittest(MacPathTestCase)
 
 
 if __name__ == "__main__":
index 43b864c3a1e3a00b175796422d16e3fcfc885871..783323fb76d7fc551fcf562700481e67a055daa6 100644 (file)
@@ -7,7 +7,7 @@ import email
 import email.message
 import re
 import io
-from test import test_support
+from test import support
 import unittest
 import mailbox
 import glob
@@ -52,7 +52,7 @@ class TestMailbox(TestBase):
     _template = 'From: foo\n\n%s'
 
     def setUp(self):
-        self._path = test_support.TESTFN
+        self._path = support.TESTFN
         self._delete_recursively(self._path)
         self._box = self._factory(self._path)
 
@@ -715,7 +715,7 @@ class _TestMboxMMDF(TestMailbox):
         self._box.close()
         self._delete_recursively(self._path)
         for lock_remnant in glob.glob(self._path + '.*'):
-            test_support.unlink(lock_remnant)
+            support.unlink(lock_remnant)
 
     def test_add_from_string(self):
         # Add a string starting with 'From ' to the mailbox
@@ -938,7 +938,7 @@ class TestBabyl(TestMailbox):
         self._box.close()
         self._delete_recursively(self._path)
         for lock_remnant in glob.glob(self._path + '.*'):
-            test_support.unlink(lock_remnant)
+            support.unlink(lock_remnant)
 
     def test_labels(self):
         # Get labels from the mailbox
@@ -964,7 +964,7 @@ class TestMessage(TestBase):
     _factory = mailbox.Message      # Overridden by subclasses to reuse tests
 
     def setUp(self):
-        self._path = test_support.TESTFN
+        self._path = support.TESTFN
 
     def tearDown(self):
         self._delete_recursively(self._path)
@@ -1580,7 +1580,7 @@ class TestProxyFileBase(TestBase):
 class TestProxyFile(TestProxyFileBase):
 
     def setUp(self):
-        self._path = test_support.TESTFN
+        self._path = support.TESTFN
         self._file = open(self._path, 'wb+')
 
     def tearDown(self):
@@ -1629,7 +1629,7 @@ class TestProxyFile(TestProxyFileBase):
 class TestPartialFile(TestProxyFileBase):
 
     def setUp(self):
-        self._path = test_support.TESTFN
+        self._path = support.TESTFN
         self._file = open(self._path, 'wb+')
 
     def tearDown(self):
@@ -1692,7 +1692,7 @@ class MaildirTestCase(unittest.TestCase):
 
     def setUp(self):
         # create a new maildir mailbox to work with:
-        self._dir = test_support.TESTFN
+        self._dir = support.TESTFN
         os.mkdir(self._dir)
         os.mkdir(os.path.join(self._dir, "cur"))
         os.mkdir(os.path.join(self._dir, "tmp"))
@@ -1733,7 +1733,7 @@ class MaildirTestCase(unittest.TestCase):
         """Test an empty maildir mailbox"""
         # Test for regression on bug #117490:
         # Make sure the boxes attribute actually gets set.
-        self.mbox = mailbox.Maildir(test_support.TESTFN)
+        self.mbox = mailbox.Maildir(support.TESTFN)
         #self.assert_(hasattr(self.mbox, "boxes"))
         #self.assertEqual(len(self.mbox.boxes), 0)
         self.assert_(self.mbox.next() is None)
@@ -1741,7 +1741,7 @@ class MaildirTestCase(unittest.TestCase):
 
     def test_nonempty_maildir_cur(self):
         self.createMessage("cur")
-        self.mbox = mailbox.Maildir(test_support.TESTFN)
+        self.mbox = mailbox.Maildir(support.TESTFN)
         #self.assertEqual(len(self.mbox.boxes), 1)
         self.assert_(self.mbox.next() is not None)
         self.assert_(self.mbox.next() is None)
@@ -1749,7 +1749,7 @@ class MaildirTestCase(unittest.TestCase):
 
     def test_nonempty_maildir_new(self):
         self.createMessage("new")
-        self.mbox = mailbox.Maildir(test_support.TESTFN)
+        self.mbox = mailbox.Maildir(support.TESTFN)
         #self.assertEqual(len(self.mbox.boxes), 1)
         self.assert_(self.mbox.next() is not None)
         self.assert_(self.mbox.next() is None)
@@ -1758,7 +1758,7 @@ class MaildirTestCase(unittest.TestCase):
     def test_nonempty_maildir_both(self):
         self.createMessage("cur")
         self.createMessage("new")
-        self.mbox = mailbox.Maildir(test_support.TESTFN)
+        self.mbox = mailbox.Maildir(support.TESTFN)
         #self.assertEqual(len(self.mbox.boxes), 2)
         self.assert_(self.mbox.next() is not None)
         self.assert_(self.mbox.next() is not None)
@@ -1856,8 +1856,8 @@ def test_main():
              TestMHMessage, TestBabylMessage, TestMMDFMessage,
              TestMessageConversion, TestProxyFile, TestPartialFile,
              MaildirTestCase)
-    test_support.run_unittest(*tests)
-    test_support.reap_children()
+    support.run_unittest(*tests)
+    support.reap_children()
 
 
 if __name__ == '__main__':
index 838207a864ec722921890d5c0558f96dc517b323..83ab852beca51911704af62b4203a0eaa2a2aaea 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-from test import test_support
+from test import support
 import marshal
 import sys
 import unittest
@@ -11,19 +11,19 @@ class HelperMixin:
         new = marshal.loads(marshal.dumps(sample, *extra))
         self.assertEqual(sample, new)
         try:
-            f = open(test_support.TESTFN, "wb")
+            f = open(support.TESTFN, "wb")
             try:
                 marshal.dump(sample, f, *extra)
             finally:
                 f.close()
-            f = open(test_support.TESTFN, "rb")
+            f = open(support.TESTFN, "rb")
             try:
                 new = marshal.load(f)
             finally:
                 f.close()
             self.assertEqual(sample, new)
         finally:
-            test_support.unlink(test_support.TESTFN)
+            support.unlink(support.TESTFN)
 
 class IntTestCase(unittest.TestCase, HelperMixin):
     def test_ints(self):
@@ -208,7 +208,7 @@ class BugsTestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(IntTestCase,
+    support.run_unittest(IntTestCase,
                               FloatTestCase,
                               StringTestCase,
                               CodeTestCase,
index ff8db7c29fc0797329d63c84c91115a277d6eea7..f24bdb3b42220e5b2e34c85c0d8b2633e8ce8fd2 100644 (file)
@@ -1,7 +1,7 @@
 # Python test set -- math module
 # XXXX Should not do tests around zero only
 
-from test.test_support import run_unittest, verbose
+from test.support import run_unittest, verbose
 import unittest
 import math
 import os
index 7857587850b7ce21381f77cf7307052c36b54317..2d91cbdeacac1affea6bfad3c8aa8ed9e9f2d236 100644 (file)
@@ -4,7 +4,7 @@ BytesIO -- for bytes
 """
 
 import unittest
-from test import test_support
+from test import support
 
 import io
 import sys
@@ -408,7 +408,7 @@ def test_main():
     tests = [PyBytesIOTest, PyStringIOTest]
     if has_c_implementation:
         tests.extend([CBytesIOTest])
-    test_support.run_unittest(*tests)
+    support.run_unittest(*tests)
 
 if __name__ == '__main__':
     test_main()
index 27adc5ec613ff06d2a87772268a1e9257deaa40b..b3d478df17fd66b26fc98eeb1b83bf3ede14027c 100644 (file)
@@ -4,7 +4,7 @@ XXX We need more tests! Some tests are in test_bytes
 """
 
 import unittest
-import test.test_support
+import test.support
 
 class MemoryviewTest(unittest.TestCase):
 
@@ -18,7 +18,7 @@ class MemoryviewTest(unittest.TestCase):
         self.assertRaises(TypeError, memoryview, ob, argument=True)
 
 def test_main():
-    test.test_support.run_unittest(MemoryviewTest)
+    test.support.run_unittest(MemoryviewTest)
 
 
 if __name__ == "__main__":
index 733418ef95512a8257bc3f294e4a8388d8e989d4..d8195dde4960df19b346c27726b3ce157b6a0d1a 100644 (file)
@@ -235,9 +235,9 @@ Make sure it works with subclassing.
 __test__ = {'doctests' : doctests}
 
 def test_main(verbose=False):
-    from test import test_support
+    from test import support
     from test import test_metaclass
-    test_support.run_doctest(test_metaclass, verbose)
+    support.run_doctest(test_metaclass, verbose)
 
 if __name__ == "__main__":
     test_main(verbose=True)
index ef333f567da5b7fdbeabf51d74cbc8619ad64644..1dc9178887b91f85993cd9c89642ff9d58b08c7a 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 
 import string, mimetools
 import io
@@ -70,7 +70,7 @@ class MimeToolsTest(unittest.TestCase):
         self.assertEqual(msg.getencoding(), "8bit")
 
 def test_main():
-    test_support.run_unittest(MimeToolsTest)
+    support.run_unittest(MimeToolsTest)
 
 if __name__=="__main__":
     test_main()
index 53de072d92fb183aa575c37989ac9f1da0b63e1c..9651a60132c18aa7fcd2a69b82ed63fdf27a251b 100644 (file)
@@ -2,7 +2,7 @@ import mimetypes
 import io
 import unittest
 
-from test import test_support
+from test import support
 
 # Tell it we don't know about external files:
 mimetypes.knownfiles = []
@@ -63,7 +63,7 @@ class MimeTypesTestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(MimeTypesTestCase)
+    support.run_unittest(MimeTypesTestCase)
 
 
 if __name__ == "__main__":
index 9ea60a9cea93dd465ec9aa75109f422b62759b91..20130c3d7265647e84f217acd422ddd5be0e09a0 100644 (file)
@@ -4,7 +4,7 @@ import os
 import sys
 import pickle
 from io import StringIO
-from test.test_support import verbose, run_unittest, TestSkipped
+from test.support import verbose, run_unittest, TestSkipped
 import unittest
 
 import xml.dom
index f01b9df4f7cf45111a5199c4dd216c1be88701fe..0b5202a4a34bb1911d84040d514ac30fa2556ae9 100644 (file)
@@ -1,4 +1,4 @@
-from test.test_support import TESTFN, run_unittest
+from test.support import TESTFN, run_unittest
 import mmap
 import unittest
 import os, re
index 35c765ecc861cac7272b0f45ff6078f9931548a6..45556e827bd893909166885d3ac0b9a59592be46 100644 (file)
@@ -1,6 +1,6 @@
 # Test the module type
 import unittest
-from test.test_support import run_unittest
+from test.support import run_unittest
 
 import sys
 ModuleType = type(sys)
index 80c06d7c30d18d5220e1987880cf4d89ac306603..85bc6697b1262f5a5a2190e7468978bd1c8944e6 100644 (file)
@@ -4,7 +4,7 @@ import unittest
 import distutils.dir_util
 import tempfile
 
-from test import test_support
+from test import support
 
 try: set
 except NameError: from sets import Set as set
@@ -258,7 +258,7 @@ class ModuleFinderTest(unittest.TestCase):
 
 def test_main():
     distutils.log.set_threshold(distutils.log.WARN)
-    test_support.run_unittest(ModuleFinderTest)
+    support.run_unittest(ModuleFinderTest)
 
 if __name__ == "__main__":
     unittest.main()
index 615ad8b05531eaa1c0ea133e579f870b2de6469d..0eb422ea764a80734e78ff8d5f9904659d3dc72a 100644 (file)
@@ -4,9 +4,9 @@
 #   Unit test for multibytecodec itself
 #
 
-from test import test_support
+from test import support
 from test import test_multibytecodec_support
-from test.test_support import TESTFN
+from test.support import TESTFN
 import unittest, io, codecs, sys, os
 
 ALL_CJKENCODINGS = [
@@ -51,7 +51,7 @@ class Test_MultibyteCodec(unittest.TestCase):
                 print('# coding:', enc, file=io.open(TESTFN, 'w'))
                 exec(open(TESTFN).read())
         finally:
-            test_support.unlink(TESTFN)
+            support.unlink(TESTFN)
 
 class Test_IncrementalEncoder(unittest.TestCase):
 
@@ -151,7 +151,7 @@ class Test_StreamReader(unittest.TestCase):
             finally:
                 f.close()
         finally:
-            test_support.unlink(TESTFN)
+            support.unlink(TESTFN)
 
 class Test_StreamWriter(unittest.TestCase):
     if len('\U00012345') == 2: # UCS2
@@ -235,7 +235,7 @@ class Test_ISO2022(unittest.TestCase):
             myunichr(x).encode('iso_2022_jp', 'ignore')
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index 5508c9d09c201aed1f77ec757e5aa6ad0f494151..3e0476e41c929460e6b7cdd261f660293512fb9d 100644 (file)
@@ -6,7 +6,7 @@
 
 import sys, codecs
 import unittest, re
-from test import test_support
+from test import support
 from io import BytesIO
 
 class TestBase:
@@ -279,10 +279,10 @@ class TestBase_Mapping(unittest.TestCase):
         try:
             self.open_mapping_file() # test it to report the error early
         except IOError:
-            raise test_support.TestSkipped("Could not retrieve "+self.mapfileurl)
+            raise support.TestSkipped("Could not retrieve "+self.mapfileurl)
 
     def open_mapping_file(self):
-        return test_support.open_urlresource(self.mapfileurl)
+        return support.open_urlresource(self.mapfileurl)
 
     def test_mapping_file(self):
         if self.mapfileurl.endswith('.xml'):
index 7fff78417c04551836fb24bedad216ee2eb656a1..b43fa47626bdd460b9deec73e4ec32e2a927b168 100644 (file)
@@ -1,4 +1,4 @@
-from test.test_support import verbose, TESTFN
+from test.support import verbose, TESTFN
 import random
 import os
 
index 4a2cb0ded05fa72ddd8cc2711f48f2c4739a4456..938e255e41a24c36918e42af64fbd365ae291a9c 100644 (file)
@@ -1,6 +1,6 @@
 
 import netrc, os, unittest, sys
-from test import test_support
+from test import support
 
 TEST_NETRC = """
 machine foo login log1 password pass1 account acct1
@@ -17,7 +17,7 @@ default login log2 password pass2
 
 """
 
-temp_filename = test_support.TESTFN
+temp_filename = support.TESTFN
 
 class NetrcTestCase(unittest.TestCase):
 
@@ -41,7 +41,7 @@ class NetrcTestCase(unittest.TestCase):
         self.assert_(nrc.hosts['default'] == ('log2', None, 'pass2'))
 
 def test_main():
-    test_support.run_unittest(NetrcTestCase)
+    support.run_unittest(NetrcTestCase)
 
 if __name__ == "__main__":
     test_main()
index 757edd6c2f16b7c4fac5f7c01ee65ac0d5755b8e..8a7efcf50ce7e9e713623f8892cf9e90a1b5e3af 100644 (file)
@@ -1,4 +1,4 @@
-from test import test_support
+from test import support
 import unittest
 import nis
 
@@ -8,7 +8,7 @@ class NisTests(unittest.TestCase):
             maps = nis.maps()
         except nis.error as msg:
             # NIS is probably not active, so this test isn't useful
-            if test_support.verbose:
+            if support.verbose:
                 print("Test Skipped:", msg)
             # Can't raise TestSkipped as regrtest only recognizes the exception
             #   import time.
@@ -37,7 +37,7 @@ class NisTests(unittest.TestCase):
                 break
 
 def test_main():
-    test_support.run_unittest(NisTests)
+    support.run_unittest(NisTests)
 
 if __name__ == '__main__':
     test_main()
index ae49996bafd814467872bf4bfe626cc979673090..920ce278b743effaa06a0fa9bf6084d20119793e 100644 (file)
@@ -1,4 +1,4 @@
-from test.test_support import run_unittest, open_urlresource
+from test.support import run_unittest, open_urlresource
 import unittest
 
 import sys
index 627b1675e4ace7f6a4e6dbcb8c5cfcfc853f4734..fa40db896174871641ca079ba0617865702fbf0b 100644 (file)
@@ -1,7 +1,7 @@
 import ntpath
 import os
-from test.test_support import verbose, TestFailed
-import test.test_support as test_support
+from test.support import verbose, TestFailed
+import test.support as support
 import unittest
 
 
@@ -180,7 +180,7 @@ class TestNtpath(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(TestNtpath)
+    support.run_unittest(TestNtpath)
 
 
 if __name__ == "__main__":
index d65c5cca53fa63d963b87620fe275854a7c04e66..42ba600843a692bfc3b1d12348dbf5c1eef53d95 100644 (file)
@@ -1,6 +1,6 @@
 # Python test set -- part 2, opcodes
 
-from test.test_support import run_unittest
+from test.support import run_unittest
 import unittest
 
 class OpcodeTest(unittest.TestCase):
index f9354967ab50be3339f98e71d754daed4dad4a32..9272c8549500547e8d38ba555f200ef2a19cf057 100644 (file)
@@ -1,7 +1,7 @@
 # Test to see if openpty works. (But don't worry if it isn't available.)
 
 import os, unittest
-from test.test_support import run_unittest, TestSkipped
+from test.support import run_unittest, TestSkipped
 
 if not hasattr(os, "openpty"):
     raise TestSkipped("No openpty() available.")
index d6146ee851a50920a0cb98c76cebe15d774ddaa5..2a02dac2f62f82f8d85ee0d2b6c2744b362b7f10 100644 (file)
@@ -1,7 +1,7 @@
 import operator
 import unittest
 
-from test import test_support
+from test import support
 
 class Seq1:
     def __init__(self, lst):
@@ -465,14 +465,14 @@ def test_main(verbose=None):
         OperatorTestCase,
     )
 
-    test_support.run_unittest(*test_classes)
+    support.run_unittest(*test_classes)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_unittest(*test_classes)
+            support.run_unittest(*test_classes)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
index 71de8695db2457e83980ce4d1ab8552bc76f7728..be2867c5ff49795de85eeb2240f504d9b7b2c3b9 100644 (file)
@@ -15,7 +15,7 @@ import copy
 import unittest
 
 from io import StringIO
-from test import test_support
+from test import support
 
 
 from optparse import make_option, Option, IndentedHelpFormatter, \
@@ -1004,10 +1004,10 @@ class TestExtendAddTypes(BaseTest):
         self.parser.add_option("-f", "--file", type="file", dest="file")
 
     def tearDown(self):
-        if os.path.isdir(test_support.TESTFN):
-            os.rmdir(test_support.TESTFN)
-        elif os.path.isfile(test_support.TESTFN):
-            os.unlink(test_support.TESTFN)
+        if os.path.isdir(support.TESTFN):
+            os.rmdir(support.TESTFN)
+        elif os.path.isfile(support.TESTFN):
+            os.unlink(support.TESTFN)
 
     class MyOption (Option):
         def check_file(option, opt, value):
@@ -1022,21 +1022,21 @@ class TestExtendAddTypes(BaseTest):
         TYPE_CHECKER["file"] = check_file
 
     def test_filetype_ok(self):
-        open(test_support.TESTFN, "w").close()
-        self.assertParseOK(["--file", test_support.TESTFN, "-afoo"],
-                           {'file': test_support.TESTFN, 'a': 'foo'},
+        open(support.TESTFN, "w").close()
+        self.assertParseOK(["--file", support.TESTFN, "-afoo"],
+                           {'file': support.TESTFN, 'a': 'foo'},
                            [])
 
     def test_filetype_noexist(self):
-        self.assertParseFail(["--file", test_support.TESTFN, "-afoo"],
+        self.assertParseFail(["--file", support.TESTFN, "-afoo"],
                              "%s: file does not exist" %
-                             test_support.TESTFN)
+                             support.TESTFN)
 
     def test_filetype_notfile(self):
-        os.mkdir(test_support.TESTFN)
-        self.assertParseFail(["--file", test_support.TESTFN, "-afoo"],
+        os.mkdir(support.TESTFN)
+        self.assertParseFail(["--file", support.TESTFN, "-afoo"],
                              "%s: not a regular file" %
-                             test_support.TESTFN)
+                             support.TESTFN)
 
 
 class TestExtendAddActions(BaseTest):
@@ -1611,7 +1611,7 @@ class TestParseNumber(BaseTest):
 
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == '__main__':
     test_main()
index 503244a24ffc8a6cfc446c92b24956f19098cddb..f0b734ebd52f7d0214b364d21098423e580453c8 100644 (file)
@@ -6,22 +6,22 @@ import os
 import unittest
 import warnings
 import sys
-from test import test_support
+from test import support
 
 # Tests creating TESTFN
 class FileTests(unittest.TestCase):
     def setUp(self):
-        if os.path.exists(test_support.TESTFN):
-            os.unlink(test_support.TESTFN)
+        if os.path.exists(support.TESTFN):
+            os.unlink(support.TESTFN)
     tearDown = setUp
 
     def test_access(self):
-        f = os.open(test_support.TESTFN, os.O_CREAT|os.O_RDWR)
+        f = os.open(support.TESTFN, os.O_CREAT|os.O_RDWR)
         os.close(f)
-        self.assert_(os.access(test_support.TESTFN, os.W_OK))
+        self.assert_(os.access(support.TESTFN, os.W_OK))
 
     def test_closerange(self):
-        f = os.open(test_support.TESTFN, os.O_CREAT|os.O_RDWR)
+        f = os.open(support.TESTFN, os.O_CREAT|os.O_RDWR)
         # close a fd that is open, and one that isn't
         os.closerange(f, f+2)
         self.assertRaises(OSError, os.write, f, "a")
@@ -29,12 +29,12 @@ class FileTests(unittest.TestCase):
 class TemporaryFileTests(unittest.TestCase):
     def setUp(self):
         self.files = []
-        os.mkdir(test_support.TESTFN)
+        os.mkdir(support.TESTFN)
 
     def tearDown(self):
         for name in self.files:
             os.unlink(name)
-        os.rmdir(test_support.TESTFN)
+        os.rmdir(support.TESTFN)
 
     def check_tempfile(self, name):
         # make sure it doesn't already exist:
@@ -51,10 +51,10 @@ class TemporaryFileTests(unittest.TestCase):
                                 r"test_os$")
         self.check_tempfile(os.tempnam())
 
-        name = os.tempnam(test_support.TESTFN)
+        name = os.tempnam(support.TESTFN)
         self.check_tempfile(name)
 
-        name = os.tempnam(test_support.TESTFN, "pfx")
+        name = os.tempnam(support.TESTFN, "pfx")
         self.assert_(os.path.basename(name)[:3] == "pfx")
         self.check_tempfile(name)
 
@@ -137,15 +137,15 @@ class TemporaryFileTests(unittest.TestCase):
 # Test attributes on return values from os.*stat* family.
 class StatAttributeTests(unittest.TestCase):
     def setUp(self):
-        os.mkdir(test_support.TESTFN)
-        self.fname = os.path.join(test_support.TESTFN, "f1")
+        os.mkdir(support.TESTFN)
+        self.fname = os.path.join(support.TESTFN, "f1")
         f = open(self.fname, 'wb')
         f.write(b"ABC")
         f.close()
 
     def tearDown(self):
         os.unlink(self.fname)
-        os.rmdir(test_support.TESTFN)
+        os.rmdir(support.TESTFN)
 
     def test_stat_attributes(self):
         if not hasattr(os, "stat"):
@@ -261,11 +261,11 @@ class StatAttributeTests(unittest.TestCase):
 
     def test_utime_dir(self):
         delta = 1000000
-        st = os.stat(test_support.TESTFN)
+        st = os.stat(support.TESTFN)
         # round to int, because some systems may support sub-second
         # time stamps in stat, but not in utime.
-        os.utime(test_support.TESTFN, (st.st_atime, int(st.st_mtime-delta)))
-        st2 = os.stat(test_support.TESTFN)
+        os.utime(support.TESTFN, (st.st_atime, int(st.st_mtime-delta)))
+        st2 = os.stat(support.TESTFN)
         self.assertEquals(st2.st_mtime, int(st.st_mtime-delta))
 
     # Restrict test to Win32, since there is no guarantee other
@@ -280,7 +280,7 @@ class StatAttributeTests(unittest.TestCase):
             if kernel32.GetVolumeInformationA(root, None, 0, None, None, None, buf, len(buf)):
                 return buf.value
 
-        if get_file_system(test_support.TESTFN) == "NTFS":
+        if get_file_system(support.TESTFN) == "NTFS":
             def test_1565150(self):
                 t1 = 1159195039.25
                 os.utime(self.fname, (t1, t1))
@@ -364,7 +364,7 @@ class WalkTests(unittest.TestCase):
         #           link/           a symlink to TESTFN.2
         #       TEST2/
         #         tmp4              a lone file
-        walk_path = join(test_support.TESTFN, "TEST1")
+        walk_path = join(support.TESTFN, "TEST1")
         sub1_path = join(walk_path, "SUB1")
         sub11_path = join(sub1_path, "SUB11")
         sub2_path = join(walk_path, "SUB2")
@@ -372,8 +372,8 @@ class WalkTests(unittest.TestCase):
         tmp2_path = join(sub1_path, "tmp2")
         tmp3_path = join(sub2_path, "tmp3")
         link_path = join(sub2_path, "link")
-        t2_path = join(test_support.TESTFN, "TEST2")
-        tmp4_path = join(test_support.TESTFN, "TEST2", "tmp4")
+        t2_path = join(support.TESTFN, "TEST2")
+        tmp4_path = join(support.TESTFN, "TEST2", "tmp4")
 
         # Create stuff.
         os.makedirs(sub11_path)
@@ -442,7 +442,7 @@ class WalkTests(unittest.TestCase):
         # Windows, which doesn't have a recursive delete command.  The
         # (not so) subtlety is that rmdir will fail unless the dir's
         # kids are removed first, so bottom up is essential.
-        for root, dirs, files in os.walk(test_support.TESTFN, topdown=False):
+        for root, dirs, files in os.walk(support.TESTFN, topdown=False):
             for name in files:
                 os.remove(os.path.join(root, name))
             for name in dirs:
@@ -451,14 +451,14 @@ class WalkTests(unittest.TestCase):
                     os.rmdir(dirname)
                 else:
                     os.remove(dirname)
-        os.rmdir(test_support.TESTFN)
+        os.rmdir(support.TESTFN)
 
 class MakedirTests(unittest.TestCase):
     def setUp(self):
-        os.mkdir(test_support.TESTFN)
+        os.mkdir(support.TESTFN)
 
     def test_makedir(self):
-        base = test_support.TESTFN
+        base = support.TESTFN
         path = os.path.join(base, 'dir1', 'dir2', 'dir3')
         os.makedirs(path)             # Should work
         path = os.path.join(base, 'dir1', 'dir2', 'dir3', 'dir4')
@@ -473,12 +473,12 @@ class MakedirTests(unittest.TestCase):
         os.makedirs(path)
 
     def tearDown(self):
-        path = os.path.join(test_support.TESTFN, 'dir1', 'dir2', 'dir3',
+        path = os.path.join(support.TESTFN, 'dir1', 'dir2', 'dir3',
                             'dir4', 'dir5', 'dir6')
         # If the tests failed, the bottom-most directory ('../dir6')
         # may not have been created, so we look for the outermost directory
         # that exists.
-        while not os.path.exists(path) and path != test_support.TESTFN:
+        while not os.path.exists(path) and path != support.TESTFN:
             path = os.path.dirname(path)
 
         os.removedirs(path)
@@ -511,32 +511,32 @@ class ExecTests(unittest.TestCase):
 
 class Win32ErrorTests(unittest.TestCase):
     def test_rename(self):
-        self.assertRaises(WindowsError, os.rename, test_support.TESTFN, test_support.TESTFN+".bak")
+        self.assertRaises(WindowsError, os.rename, support.TESTFN, support.TESTFN+".bak")
 
     def test_remove(self):
-        self.assertRaises(WindowsError, os.remove, test_support.TESTFN)
+        self.assertRaises(WindowsError, os.remove, support.TESTFN)
 
     def test_chdir(self):
-        self.assertRaises(WindowsError, os.chdir, test_support.TESTFN)
+        self.assertRaises(WindowsError, os.chdir, support.TESTFN)
 
     def test_mkdir(self):
-        self.assertRaises(WindowsError, os.chdir, test_support.TESTFN)
+        self.assertRaises(WindowsError, os.chdir, support.TESTFN)
 
     def test_utime(self):
-        self.assertRaises(WindowsError, os.utime, test_support.TESTFN, None)
+        self.assertRaises(WindowsError, os.utime, support.TESTFN, None)
 
     def test_access(self):
-        self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0)
+        self.assertRaises(WindowsError, os.utime, support.TESTFN, 0)
 
     def test_chmod(self):
-        self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0)
+        self.assertRaises(WindowsError, os.utime, support.TESTFN, 0)
 
 if sys.platform != 'win32':
     class Win32ErrorTests(unittest.TestCase):
         pass
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         FileTests,
         StatAttributeTests,
         EnvironTests,
index 8f9bf6f1a6c8729a9eef5b31cbf7884f8094909d..6f8de97ccc593637183f11c4d50005795d5431e9 100644 (file)
@@ -1,7 +1,7 @@
-from test import test_support
-test_support.requires('audio')
+from test import support
+support.requires('audio')
 
-from test.test_support import findfile, TestSkipped
+from test.support import findfile, TestSkipped
 
 import errno
 import ossaudiodev
@@ -167,7 +167,7 @@ def test_main():
             raise TestSkipped(msg)
         raise
     dsp.close()
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index 7269ccb01215fc62bcb6d2f195050b956935d79d..e4179620e71f4e78733feaddf07161987f785b86 100644 (file)
@@ -1,7 +1,7 @@
 import parser
 import unittest
 import sys
-from test import test_support
+from test import support
 
 #
 #  First, we test that we can generate trees from valid source fragments,
@@ -471,7 +471,7 @@ class ParserStackLimitTestCase(unittest.TestCase):
         self.assertRaises(MemoryError, parser.expr, e)
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         RoundtripLegalSyntaxTestCase,
         IllegalSyntaxTestCase,
         CompileTestCase,
index faa55233db751491c2216659df987e5456b74f7e..f3e240e8f8b154ed45150ce67bce36788ef695d9 100644 (file)
@@ -220,16 +220,16 @@ class TestTranforms(unittest.TestCase):
 
 def test_main(verbose=None):
     import sys
-    from test import test_support
+    from test import support
     test_classes = (TestTranforms,)
-    test_support.run_unittest(*test_classes)
+    support.run_unittest(*test_classes)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_unittest(*test_classes)
+            support.run_unittest(*test_classes)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
index 947896938fe536bd2f76f73aea6d50012e0b0d2d..733109a16e796aa3a4b60d3ee3a6defbdadf334f 100644 (file)
@@ -6,7 +6,7 @@ for hashing algorithms
 import hmac
 import unittest
 from hashlib import md5, sha1, sha224, sha256, sha384, sha512
-from test import test_support
+from test import support
 
 class Pep247Test(unittest.TestCase):
 
@@ -62,7 +62,7 @@ class Pep247Test(unittest.TestCase):
         self.check_module(hmac, key=b'abc')
 
 def test_main():
-    test_support.run_unittest(Pep247Test)
+    support.run_unittest(Pep247Test)
 
 if __name__ == '__main__':
     test_main()
index 92065c9fe1513529c261b46953687b0fcddbd4d8..17abbd807a01cd3a0a7c6bef8cff54b269aadab3 100644 (file)
@@ -2,7 +2,7 @@
 # This file is marked as binary in the CVS, to prevent MacCVS from recoding it.\r
 \r
 import unittest\r
-from test import test_support\r
+from test import support\r
 \r
 class PEP263Test(unittest.TestCase):\r
 \r
@@ -32,7 +32,7 @@ class PEP263Test(unittest.TestCase):
             self.fail()\r
 \r
 def test_main():\r
-    test_support.run_unittest(PEP263Test)\r
+    support.run_unittest(PEP263Test)\r
 \r
 if __name__=="__main__":\r
     test_main()\r
index 770b52627577afb1f390b32a73760e05700d2a84..eac513849491d17d5d48a7763a49fa8a3897cc2d 100644 (file)
@@ -1,9 +1,9 @@
 # Test the Unicode versions of normal file functions
 # open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
 import sys, os, unittest
-from test import test_support
+from test import support
 if not os.path.supports_unicode_filenames:
-    raise test_support.TestSkipped("test works only on NT+")
+    raise support.TestSkipped("test works only on NT+")
 
 filenames = [
     'abc',
@@ -28,11 +28,11 @@ def deltree(dirname):
         os.rmdir(dirname)
 
 class UnicodeFileTests(unittest.TestCase):
-    files = [os.path.join(test_support.TESTFN, f) for f in filenames]
+    files = [os.path.join(support.TESTFN, f) for f in filenames]
 
     def setUp(self):
         try:
-            os.mkdir(test_support.TESTFN)
+            os.mkdir(support.TESTFN)
         except OSError:
             pass
         for name in self.files:
@@ -42,17 +42,17 @@ class UnicodeFileTests(unittest.TestCase):
             os.stat(name)
 
     def tearDown(self):
-        deltree(test_support.TESTFN)
+        deltree(support.TESTFN)
 
     def _apply_failure(self, fn, filename, expected_exception,
                        check_fn_in_exception = True):
         try:
             fn(filename)
-            raise test_support.TestFailed("Expected to fail calling '%s(%r)'"
+            raise support.TestFailed("Expected to fail calling '%s(%r)'"
                              % (fn.__name__, filename))
         except expected_exception as details:
             if check_fn_in_exception and details.filename != filename:
-                raise test_support.TestFailed("Function '%s(%r) failed with "
+                raise support.TestFailed("Function '%s(%r) failed with "
                                  "bad filename in the exception: %r"
                                  % (fn.__name__, filename,
                                     details.filename))
@@ -77,10 +77,10 @@ class UnicodeFileTests(unittest.TestCase):
             os.stat(name)
 
     def test_listdir(self):
-        f1 = os.listdir(test_support.TESTFN)
-        f2 = os.listdir(str(test_support.TESTFN.encode("utf-8"),
+        f1 = os.listdir(support.TESTFN)
+        f2 = os.listdir(str(support.TESTFN.encode("utf-8"),
                                 sys.getfilesystemencoding()))
-        sf2 = set("\\".join((str(test_support.TESTFN), f))
+        sf2 = set("\\".join((str(support.TESTFN), f))
                   for f in f2)
         self.failUnlessEqual(len(f1), len(self.files))
         self.failUnlessEqual(sf2, set(self.files))
@@ -91,7 +91,7 @@ class UnicodeFileTests(unittest.TestCase):
             os.rename("tmp",name)
 
     def test_directory(self):
-        dirname = os.path.join(test_support.TESTFN,'Gr\xfc\xdf-\u66e8\u66e9\u66eb')
+        dirname = os.path.join(support.TESTFN,'Gr\xfc\xdf-\u66e8\u66e9\u66eb')
         filename = '\xdf-\u66e8\u66e9\u66eb'
         oldwd = os.getcwd()
         os.mkdir(dirname)
@@ -106,9 +106,9 @@ class UnicodeFileTests(unittest.TestCase):
 
 def test_main():
     try:
-        test_support.run_unittest(UnicodeFileTests)
+        support.run_unittest(UnicodeFileTests)
     finally:
-        deltree(test_support.TESTFN)
+        deltree(support.TESTFN)
 
 if __name__ == "__main__":
     test_main()
index 98204901e37476955b501e9c4b0fe297579898ab..ce9b66363b76663f1c0d320a10aeee6ebd35c432 100644 (file)
@@ -185,9 +185,9 @@ class TestTemplate(unittest.TestCase):
 
 
 def test_main():
-    from test import test_support
+    from test import support
     test_classes = [TestTemplate,]
-    test_support.run_unittest(*test_classes)
+    support.run_unittest(*test_classes)
 
 
 if __name__ == '__main__':
index 3f567bf588372d1c1d3e88318088710bde1a4858..3bb30ca76144a9671a812144a1759b48c2bad885 100644 (file)
@@ -1,7 +1,7 @@
 # This file is marked as binary in the CVS, to prevent MacCVS from recoding it.
 
 import unittest
-from test import test_support
+from test import support
 
 class PEP3120Test(unittest.TestCase):
 
@@ -24,7 +24,7 @@ class PEP3120Test(unittest.TestCase):
             self.fail("expected exception didn't occur")
 
 def test_main():
-    test_support.run_unittest(PEP3120Test)
+    support.run_unittest(PEP3120Test)
 
 if __name__=="__main__":
     test_main()
index 94801c965c807122b47f74b51aff2af769347bcf..e4c2d031e20ac4f7da694e7a3d4941fa24773e19 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 import unittest
-from test import test_support
+from test import support
 
 class PEP3131Test(unittest.TestCase):
 
@@ -23,7 +23,7 @@ class PEP3131Test(unittest.TestCase):
             self.fail("expected exception didn't occur")
 
 def test_main():
-    test_support.run_unittest(PEP3131Test)
+    support.run_unittest(PEP3131Test)
 
 if __name__=="__main__":
     test_main()
index db117ef2a85d2e7ea9c0e86b664bdc9d28b27ad3..5d75667b683a426d46c191e39822ca33d51fb713 100644 (file)
@@ -1,7 +1,7 @@
 import unittest
 import builtins
 import warnings
-from test.test_support import run_unittest
+from test.support import run_unittest
 import os
 from platform import system as platform_system
 
index 67d83c7c367b5c3a906b1319e905e971e3072afe..42fb33ee7a2bfb0a28f44f676263125e8db76697 100644 (file)
@@ -1,7 +1,7 @@
 import pickle
 import io
 
-from test import test_support
+from test import support
 
 from test.pickletester import AbstractPickleTests
 from test.pickletester import AbstractPickleModuleTests
@@ -55,12 +55,12 @@ class PersPicklerTests(AbstractPersistentPicklerTests):
         return u.load()
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         PickleTests,
         PicklerTests,
         PersPicklerTests
     )
-    test_support.run_doctest(pickle)
+    support.run_doctest(pickle)
 
 if __name__ == "__main__":
     test_main()
index 932dcd19dd293a0b39aae4c5067789e443cf2e95..ccb6c9c7346a6b3028c6866b20e8e705b1f80465 100644 (file)
@@ -1,6 +1,6 @@
 import pickle
 import pickletools
-from test import test_support
+from test import support
 from test.pickletester import AbstractPickleTests
 from test.pickletester import AbstractPickleModuleTests
 
@@ -16,8 +16,8 @@ class OptimizedPickleTests(AbstractPickleTests, AbstractPickleModuleTests):
     error = KeyError
 
 def test_main():
-    test_support.run_unittest(OptimizedPickleTests)
-    test_support.run_doctest(pickletools)
+    support.run_unittest(OptimizedPickleTests)
+    support.run_doctest(pickletools)
 
 
 if __name__ == "__main__":
index 63eaa4daab8a75ca8ca7a32e92ad7bcd196bf112..d55f3524f67847384c3d236a893162bfc5f572b6 100644 (file)
@@ -2,7 +2,7 @@ import pipes
 import os
 import string
 import unittest
-from test.test_support import TESTFN, run_unittest, unlink, TestSkipped
+from test.support import TESTFN, run_unittest, unlink, TestSkipped
 
 if os.name != 'posix':
     raise TestSkipped('pipes module only works on posix')
index db8e844215317860b0fe3c8b98c28dffe614cf73..1064617f2d8588ab3a45f2c8272d0d490d646704 100644 (file)
@@ -5,7 +5,7 @@ import os
 import tempfile
 import textwrap
 import unittest
-from test import test_support
+from test import support
 
 
 # Helpers to create and destroy hierarchies.
@@ -280,7 +280,7 @@ class TestPkg(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 
 if __name__ == "__main__":
index 316ea832a51deadef3a045430c2e160f243f67c5..eff7b5a25da2abb77135c12f953dcd2e5a31551e 100644 (file)
@@ -1,6 +1,6 @@
 import os, sys, string, random, tempfile, unittest
 
-from test.test_support import run_unittest
+from test.support import run_unittest
 
 class TestImport(unittest.TestCase):
 
index dfd24301eb927fbbc89cbae33c2f8d2a07b965cf..169ef664113245eaf49958f1717f4a7563c749c1 100644 (file)
@@ -1,4 +1,4 @@
-from test.test_support import run_unittest
+from test.support import run_unittest
 import unittest
 import sys
 import imp
index fced4d021529d4a68710ca9f99e5c903a8120303..3758060b51feba14b23c34e81cc18a953e81e8ff 100644 (file)
@@ -2,7 +2,7 @@ import sys
 import unittest
 import platform
 
-from test import test_support
+from test import support
 
 class PlatformTest(unittest.TestCase):
     def test_architecture(self):
@@ -82,7 +82,7 @@ class PlatformTest(unittest.TestCase):
         res = platform.libc_ver(sys.executable)
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         PlatformTest
     )
 
index 883b01f6cfc1c19ded5dae5e20da774b3b30c463..b9a46b74a07ea9527c8b3942ab70ba54c9b767ee 100644 (file)
@@ -4,7 +4,7 @@ import unittest
 import plistlib
 import os
 import datetime
-from test import test_support
+from test import support
 
 
 # This test data was generated through Cocoa's NSDictionary class
@@ -91,7 +91,7 @@ class TestPlistlib(unittest.TestCase):
 
     def tearDown(self):
         try:
-            os.unlink(test_support.TESTFN)
+            os.unlink(support.TESTFN)
         except:
             pass
 
@@ -123,8 +123,8 @@ class TestPlistlib(unittest.TestCase):
 
     def test_io(self):
         pl = self._create()
-        plistlib.writePlist(pl, test_support.TESTFN)
-        pl2 = plistlib.readPlist(test_support.TESTFN)
+        plistlib.writePlist(pl, support.TESTFN)
+        pl2 = plistlib.readPlist(support.TESTFN)
         self.assertEqual(dict(pl), dict(pl2))
 
     def test_bytes(self):
@@ -177,7 +177,7 @@ class TestPlistlib(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(TestPlistlib)
+    support.run_unittest(TestPlistlib)
 
 
 if __name__ == '__main__':
index d546c7884950e5c44137769a03e6ec239d9ba520..c346ba005f20e78df011564321324abe5ee90e84 100644 (file)
@@ -1,7 +1,7 @@
 # Test case for the os.poll() function
 
 import os, select, random, unittest
-from test.test_support import TestSkipped, TESTFN, run_unittest
+from test.support import TestSkipped, TESTFN, run_unittest
 
 try:
     select.poll
index 209bb13148c6812eddcae33695b49a1778a28dc2..d72879280cf6971b824609a4397fdf10cf291345 100644 (file)
@@ -5,7 +5,7 @@
 """
 
 import unittest
-from test import test_support
+from test import support
 import os, sys
 
 # Test that command-lines get down as we expect.
@@ -40,10 +40,10 @@ class PopenTest(unittest.TestCase):
             'foo "a \\"quoted\\" arg" bar',
             ["foo", 'a "quoted" arg', "bar"]
         )
-        test_support.reap_children()
+        support.reap_children()
 
 def test_main():
-    test_support.run_unittest(PopenTest)
+    support.run_unittest(PopenTest)
 
 if __name__ == "__main__":
     test_main()
index cd550df119cb1a4c75e402c50ae889e8775bb25d..14b46e31626d1e4845433587e66a2a6aedcd59a7 100644 (file)
@@ -4,9 +4,9 @@ import poplib
 import time
 
 from unittest import TestCase
-from test import test_support
+from test import support
 
-HOST = test_support.HOST
+HOST = support.HOST
 
 def server(evt, serv):
     serv.listen(5)
@@ -27,7 +27,7 @@ class GeneralTests(TestCase):
         self.evt = threading.Event()
         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         self.sock.settimeout(3)
-        self.port = test_support.bind_port(self.sock)
+        self.port = support.bind_port(self.sock)
         threading.Thread(target=server, args=(self.evt,self.sock)).start()
         time.sleep(.1)
 
@@ -65,7 +65,7 @@ class GeneralTests(TestCase):
 
 
 def test_main(verbose=None):
-    test_support.run_unittest(GeneralTests)
+    support.run_unittest(GeneralTests)
 
 if __name__ == '__main__':
     test_main()
index 57e9d15afe5c9d1fd35f6caad93cdfe2625a2d96..f16abb2f6ebbf1924e87aac967d5bcd881bb6b84 100644 (file)
@@ -1,11 +1,11 @@
 "Test posix functions"
 
-from test import test_support
+from test import support
 
 try:
     import posix
 except ImportError:
-    raise test_support.TestSkipped("posix is not available")
+    raise support.TestSkipped("posix is not available")
 
 import time
 import os
@@ -19,11 +19,11 @@ class PosixTester(unittest.TestCase):
 
     def setUp(self):
         # create empty file
-        fp = open(test_support.TESTFN, 'w+')
+        fp = open(support.TESTFN, 'w+')
         fp.close()
 
     def tearDown(self):
-        os.unlink(test_support.TESTFN)
+        os.unlink(support.TESTFN)
 
     def testNoArgFunctions(self):
         # test posix functions which take no arguments and have
@@ -46,7 +46,7 @@ class PosixTester(unittest.TestCase):
 
     def test_fstatvfs(self):
         if hasattr(posix, 'fstatvfs'):
-            fp = open(test_support.TESTFN)
+            fp = open(support.TESTFN)
             try:
                 self.assert_(posix.fstatvfs(fp.fileno()))
             finally:
@@ -54,7 +54,7 @@ class PosixTester(unittest.TestCase):
 
     def test_ftruncate(self):
         if hasattr(posix, 'ftruncate'):
-            fp = open(test_support.TESTFN, 'w+')
+            fp = open(support.TESTFN, 'w+')
             try:
                 # we need to have some data to truncate
                 fp.write('test')
@@ -65,7 +65,7 @@ class PosixTester(unittest.TestCase):
 
     def test_dup(self):
         if hasattr(posix, 'dup'):
-            fp = open(test_support.TESTFN)
+            fp = open(support.TESTFN)
             try:
                 fd = posix.dup(fp.fileno())
                 self.assert_(isinstance(fd, int))
@@ -80,8 +80,8 @@ class PosixTester(unittest.TestCase):
 
     def test_dup2(self):
         if hasattr(posix, 'dup2'):
-            fp1 = open(test_support.TESTFN)
-            fp2 = open(test_support.TESTFN)
+            fp1 = open(support.TESTFN)
+            fp2 = open(support.TESTFN)
             try:
                 posix.dup2(fp1.fileno(), fp2.fileno())
             finally:
@@ -89,7 +89,7 @@ class PosixTester(unittest.TestCase):
                 fp2.close()
 
     def fdopen_helper(self, *args):
-        fd = os.open(test_support.TESTFN, os.O_RDONLY)
+        fd = os.open(support.TESTFN, os.O_RDONLY)
         fp2 = posix.fdopen(fd, *args)
         fp2.close()
 
@@ -101,38 +101,38 @@ class PosixTester(unittest.TestCase):
 
     def test_osexlock(self):
         if hasattr(posix, "O_EXLOCK"):
-            fd = os.open(test_support.TESTFN,
+            fd = os.open(support.TESTFN,
                          os.O_WRONLY|os.O_EXLOCK|os.O_CREAT)
-            self.assertRaises(OSError, os.open, test_support.TESTFN,
+            self.assertRaises(OSError, os.open, support.TESTFN,
                               os.O_WRONLY|os.O_EXLOCK|os.O_NONBLOCK)
             os.close(fd)
 
             if hasattr(posix, "O_SHLOCK"):
-                fd = os.open(test_support.TESTFN,
+                fd = os.open(support.TESTFN,
                              os.O_WRONLY|os.O_SHLOCK|os.O_CREAT)
-                self.assertRaises(OSError, os.open, test_support.TESTFN,
+                self.assertRaises(OSError, os.open, support.TESTFN,
                                   os.O_WRONLY|os.O_EXLOCK|os.O_NONBLOCK)
                 os.close(fd)
 
     def test_osshlock(self):
         if hasattr(posix, "O_SHLOCK"):
-            fd1 = os.open(test_support.TESTFN,
+            fd1 = os.open(support.TESTFN,
                          os.O_WRONLY|os.O_SHLOCK|os.O_CREAT)
-            fd2 = os.open(test_support.TESTFN,
+            fd2 = os.open(support.TESTFN,
                           os.O_WRONLY|os.O_SHLOCK|os.O_CREAT)
             os.close(fd2)
             os.close(fd1)
 
             if hasattr(posix, "O_EXLOCK"):
-                fd = os.open(test_support.TESTFN,
+                fd = os.open(support.TESTFN,
                              os.O_WRONLY|os.O_SHLOCK|os.O_CREAT)
-                self.assertRaises(OSError, os.open, test_support.TESTFN,
+                self.assertRaises(OSError, os.open, support.TESTFN,
                                   os.O_RDONLY|os.O_EXLOCK|os.O_NONBLOCK)
                 os.close(fd)
 
     def test_fstat(self):
         if hasattr(posix, 'fstat'):
-            fp = open(test_support.TESTFN)
+            fp = open(support.TESTFN)
             try:
                 self.assert_(posix.fstat(fp.fileno()))
             finally:
@@ -140,16 +140,16 @@ class PosixTester(unittest.TestCase):
 
     def test_stat(self):
         if hasattr(posix, 'stat'):
-            self.assert_(posix.stat(test_support.TESTFN))
+            self.assert_(posix.stat(support.TESTFN))
 
     if hasattr(posix, 'chown'):
         def test_chown(self):
             # raise an OSError if the file does not exist
-            os.unlink(test_support.TESTFN)
-            self.assertRaises(OSError, posix.chown, test_support.TESTFN, -1, -1)
+            os.unlink(support.TESTFN)
+            self.assertRaises(OSError, posix.chown, support.TESTFN, -1, -1)
 
             # re-create the file
-            open(test_support.TESTFN, 'w').close()
+            open(support.TESTFN, 'w').close()
             if os.getuid() == 0:
                 try:
                     # Many linux distros have a nfsnobody user as MAX_UID-2
@@ -158,29 +158,29 @@ class PosixTester(unittest.TestCase):
                     # This part of the test only runs when run as root.
                     # Only scary people run their tests as root.
                     ent = pwd.getpwnam('nfsnobody')
-                    posix.chown(test_support.TESTFN, ent.pw_uid, ent.pw_gid)
+                    posix.chown(support.TESTFN, ent.pw_uid, ent.pw_gid)
                 except KeyError:
                     pass
             else:
                 # non-root cannot chown to root, raises OSError
                 self.assertRaises(OSError, posix.chown,
-                                  test_support.TESTFN, 0, 0)
+                                  support.TESTFN, 0, 0)
 
             # test a successful chown call
-            posix.chown(test_support.TESTFN, os.getuid(), os.getgid())
+            posix.chown(support.TESTFN, os.getuid(), os.getgid())
 
     def test_chdir(self):
         if hasattr(posix, 'chdir'):
             posix.chdir(os.curdir)
-            self.assertRaises(OSError, posix.chdir, test_support.TESTFN)
+            self.assertRaises(OSError, posix.chdir, support.TESTFN)
 
     def test_lsdir(self):
         if hasattr(posix, 'lsdir'):
-            self.assert_(test_support.TESTFN in posix.lsdir(os.curdir))
+            self.assert_(support.TESTFN in posix.lsdir(os.curdir))
 
     def test_access(self):
         if hasattr(posix, 'access'):
-            self.assert_(posix.access(test_support.TESTFN, os.R_OK))
+            self.assert_(posix.access(support.TESTFN, os.R_OK))
 
     def test_umask(self):
         if hasattr(posix, 'umask'):
@@ -201,24 +201,24 @@ class PosixTester(unittest.TestCase):
     def test_utime(self):
         if hasattr(posix, 'utime'):
             now = time.time()
-            posix.utime(test_support.TESTFN, None)
-            self.assertRaises(TypeError, posix.utime, test_support.TESTFN, (None, None))
-            self.assertRaises(TypeError, posix.utime, test_support.TESTFN, (now, None))
-            self.assertRaises(TypeError, posix.utime, test_support.TESTFN, (None, now))
-            posix.utime(test_support.TESTFN, (int(now), int(now)))
-            posix.utime(test_support.TESTFN, (now, now))
+            posix.utime(support.TESTFN, None)
+            self.assertRaises(TypeError, posix.utime, support.TESTFN, (None, None))
+            self.assertRaises(TypeError, posix.utime, support.TESTFN, (now, None))
+            self.assertRaises(TypeError, posix.utime, support.TESTFN, (None, now))
+            posix.utime(support.TESTFN, (int(now), int(now)))
+            posix.utime(support.TESTFN, (now, now))
 
     def test_chflags(self):
         if hasattr(posix, 'chflags'):
-            st = os.stat(test_support.TESTFN)
+            st = os.stat(support.TESTFN)
             if hasattr(st, 'st_flags'):
-                posix.chflags(test_support.TESTFN, st.st_flags)
+                posix.chflags(support.TESTFN, st.st_flags)
 
     def test_lchflags(self):
         if hasattr(posix, 'lchflags'):
-            st = os.stat(test_support.TESTFN)
+            st = os.stat(support.TESTFN)
             if hasattr(st, 'st_flags'):
-                posix.lchflags(test_support.TESTFN, st.st_flags)
+                posix.lchflags(support.TESTFN, st.st_flags)
 
     def test_environ(self):
         for k, v in posix.environ.items():
@@ -226,7 +226,7 @@ class PosixTester(unittest.TestCase):
             self.assertEqual(type(v), str)
 
 def test_main():
-    test_support.run_unittest(PosixTester)
+    support.run_unittest(PosixTester)
 
 if __name__ == '__main__':
     test_main()
index a25e2b21597d7ad16565e16cc00d818785b37a38..8a7dd72224b916c3e5cbb9be102e5aa7c728015c 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 
 import posixpath, os
 from posixpath import realpath, abspath, join, dirname, basename, relpath
@@ -7,7 +7,7 @@ from posixpath import realpath, abspath, join, dirname, basename, relpath
 # An absolute path to a temporary filename for testing. We can't rely on TESTFN
 # being an absolute path, so we need this.
 
-ABSTFN = abspath(test_support.TESTFN)
+ABSTFN = abspath(support.TESTFN)
 
 def safe_rmdir(dirname):
     try:
@@ -22,8 +22,8 @@ class PosixPathTest(unittest.TestCase):
 
     def tearDown(self):
         for suffix in ["", "1", "2"]:
-            test_support.unlink(test_support.TESTFN + suffix)
-            safe_rmdir(test_support.TESTFN + suffix)
+            support.unlink(support.TESTFN + suffix)
+            safe_rmdir(support.TESTFN + suffix)
 
     def assertIs(self, a, b):
         self.assert_(a is b)
@@ -141,50 +141,50 @@ class PosixPathTest(unittest.TestCase):
                     self.assertNotEqual(s1[n:n+1], s2[n:n+1])
 
     def test_getsize(self):
-        f = open(test_support.TESTFN, "wb")
+        f = open(support.TESTFN, "wb")
         try:
             f.write(b"foo")
             f.close()
-            self.assertEqual(posixpath.getsize(test_support.TESTFN), 3)
+            self.assertEqual(posixpath.getsize(support.TESTFN), 3)
         finally:
             if not f.closed:
                 f.close()
 
     def test_time(self):
-        f = open(test_support.TESTFN, "wb")
+        f = open(support.TESTFN, "wb")
         try:
             f.write(b"foo")
             f.close()
-            f = open(test_support.TESTFN, "ab")
+            f = open(support.TESTFN, "ab")
             f.write(b"bar")
             f.close()
-            f = open(test_support.TESTFN, "rb")
+            f = open(support.TESTFN, "rb")
             d = f.read()
             f.close()
             self.assertEqual(d, b"foobar")
 
             self.assert_(
-                posixpath.getctime(test_support.TESTFN) <=
-                posixpath.getmtime(test_support.TESTFN)
+                posixpath.getctime(support.TESTFN) <=
+                posixpath.getmtime(support.TESTFN)
             )
         finally:
             if not f.closed:
                 f.close()
 
     def test_islink(self):
-        self.assertIs(posixpath.islink(test_support.TESTFN + "1"), False)
-        f = open(test_support.TESTFN + "1", "wb")
+        self.assertIs(posixpath.islink(support.TESTFN + "1"), False)
+        f = open(support.TESTFN + "1", "wb")
         try:
             f.write(b"foo")
             f.close()
-            self.assertIs(posixpath.islink(test_support.TESTFN + "1"), False)
+            self.assertIs(posixpath.islink(support.TESTFN + "1"), False)
             if hasattr(os, "symlink"):
-                os.symlink(test_support.TESTFN + "1", test_support.TESTFN + "2")
-                self.assertIs(posixpath.islink(test_support.TESTFN + "2"), True)
-                os.remove(test_support.TESTFN + "1")
-                self.assertIs(posixpath.islink(test_support.TESTFN + "2"), True)
-                self.assertIs(posixpath.exists(test_support.TESTFN + "2"), False)
-                self.assertIs(posixpath.lexists(test_support.TESTFN + "2"), True)
+                os.symlink(support.TESTFN + "1", support.TESTFN + "2")
+                self.assertIs(posixpath.islink(support.TESTFN + "2"), True)
+                os.remove(support.TESTFN + "1")
+                self.assertIs(posixpath.islink(support.TESTFN + "2"), True)
+                self.assertIs(posixpath.exists(support.TESTFN + "2"), False)
+                self.assertIs(posixpath.lexists(support.TESTFN + "2"), True)
         finally:
             if not f.close():
                 f.close()
@@ -192,13 +192,13 @@ class PosixPathTest(unittest.TestCase):
         self.assertRaises(TypeError, posixpath.islink)
 
     def test_exists(self):
-        self.assertIs(posixpath.exists(test_support.TESTFN), False)
-        f = open(test_support.TESTFN, "wb")
+        self.assertIs(posixpath.exists(support.TESTFN), False)
+        f = open(support.TESTFN, "wb")
         try:
             f.write(b"foo")
             f.close()
-            self.assertIs(posixpath.exists(test_support.TESTFN), True)
-            self.assertIs(posixpath.lexists(test_support.TESTFN), True)
+            self.assertIs(posixpath.exists(support.TESTFN), True)
+            self.assertIs(posixpath.lexists(support.TESTFN), True)
         finally:
             if not f.close():
                 f.close()
@@ -206,16 +206,16 @@ class PosixPathTest(unittest.TestCase):
         self.assertRaises(TypeError, posixpath.exists)
 
     def test_isdir(self):
-        self.assertIs(posixpath.isdir(test_support.TESTFN), False)
-        f = open(test_support.TESTFN, "wb")
+        self.assertIs(posixpath.isdir(support.TESTFN), False)
+        f = open(support.TESTFN, "wb")
         try:
             f.write(b"foo")
             f.close()
-            self.assertIs(posixpath.isdir(test_support.TESTFN), False)
-            os.remove(test_support.TESTFN)
-            os.mkdir(test_support.TESTFN)
-            self.assertIs(posixpath.isdir(test_support.TESTFN), True)
-            os.rmdir(test_support.TESTFN)
+            self.assertIs(posixpath.isdir(support.TESTFN), False)
+            os.remove(support.TESTFN)
+            os.mkdir(support.TESTFN)
+            self.assertIs(posixpath.isdir(support.TESTFN), True)
+            os.rmdir(support.TESTFN)
         finally:
             if not f.close():
                 f.close()
@@ -223,16 +223,16 @@ class PosixPathTest(unittest.TestCase):
         self.assertRaises(TypeError, posixpath.isdir)
 
     def test_isfile(self):
-        self.assertIs(posixpath.isfile(test_support.TESTFN), False)
-        f = open(test_support.TESTFN, "wb")
+        self.assertIs(posixpath.isfile(support.TESTFN), False)
+        f = open(support.TESTFN, "wb")
         try:
             f.write(b"foo")
             f.close()
-            self.assertIs(posixpath.isfile(test_support.TESTFN), True)
-            os.remove(test_support.TESTFN)
-            os.mkdir(test_support.TESTFN)
-            self.assertIs(posixpath.isfile(test_support.TESTFN), False)
-            os.rmdir(test_support.TESTFN)
+            self.assertIs(posixpath.isfile(support.TESTFN), True)
+            os.remove(support.TESTFN)
+            os.mkdir(support.TESTFN)
+            self.assertIs(posixpath.isfile(support.TESTFN), False)
+            os.rmdir(support.TESTFN)
         finally:
             if not f.close():
                 f.close()
@@ -240,14 +240,14 @@ class PosixPathTest(unittest.TestCase):
         self.assertRaises(TypeError, posixpath.isdir)
 
     def test_samefile(self):
-        f = open(test_support.TESTFN + "1", "wb")
+        f = open(support.TESTFN + "1", "wb")
         try:
             f.write(b"foo")
             f.close()
             self.assertIs(
                 posixpath.samefile(
-                    test_support.TESTFN + "1",
-                    test_support.TESTFN + "1"
+                    support.TESTFN + "1",
+                    support.TESTFN + "1"
                 ),
                 True
             )
@@ -255,24 +255,24 @@ class PosixPathTest(unittest.TestCase):
             # inode information and thus, that samefile() doesn't work
             if hasattr(os, "symlink"):
                 os.symlink(
-                    test_support.TESTFN + "1",
-                    test_support.TESTFN + "2"
+                    support.TESTFN + "1",
+                    support.TESTFN + "2"
                 )
                 self.assertIs(
                     posixpath.samefile(
-                        test_support.TESTFN + "1",
-                        test_support.TESTFN + "2"
+                        support.TESTFN + "1",
+                        support.TESTFN + "2"
                     ),
                     True
                 )
-                os.remove(test_support.TESTFN + "2")
-                f = open(test_support.TESTFN + "2", "wb")
+                os.remove(support.TESTFN + "2")
+                f = open(support.TESTFN + "2", "wb")
                 f.write(b"bar")
                 f.close()
                 self.assertIs(
                     posixpath.samefile(
-                        test_support.TESTFN + "1",
-                        test_support.TESTFN + "2"
+                        support.TESTFN + "1",
+                        support.TESTFN + "2"
                     ),
                     False
                 )
@@ -283,14 +283,14 @@ class PosixPathTest(unittest.TestCase):
         self.assertRaises(TypeError, posixpath.samefile)
 
     def test_samestat(self):
-        f = open(test_support.TESTFN + "1", "wb")
+        f = open(support.TESTFN + "1", "wb")
         try:
             f.write(b"foo")
             f.close()
             self.assertIs(
                 posixpath.samestat(
-                    os.stat(test_support.TESTFN + "1"),
-                    os.stat(test_support.TESTFN + "1")
+                    os.stat(support.TESTFN + "1"),
+                    os.stat(support.TESTFN + "1")
                 ),
                 True
             )
@@ -298,22 +298,22 @@ class PosixPathTest(unittest.TestCase):
             # inode information and thus, that samefile() doesn't work
             if hasattr(os, "symlink"):
                 if hasattr(os, "symlink"):
-                    os.symlink(test_support.TESTFN + "1", test_support.TESTFN + "2")
+                    os.symlink(support.TESTFN + "1", support.TESTFN + "2")
                     self.assertIs(
                         posixpath.samestat(
-                            os.stat(test_support.TESTFN + "1"),
-                            os.stat(test_support.TESTFN + "2")
+                            os.stat(support.TESTFN + "1"),
+                            os.stat(support.TESTFN + "2")
                         ),
                         True
                     )
-                    os.remove(test_support.TESTFN + "2")
-                f = open(test_support.TESTFN + "2", "wb")
+                    os.remove(support.TESTFN + "2")
+                f = open(support.TESTFN + "2", "wb")
                 f.write(b"bar")
                 f.close()
                 self.assertIs(
                     posixpath.samestat(
-                        os.stat(test_support.TESTFN + "1"),
-                        os.stat(test_support.TESTFN + "2")
+                        os.stat(support.TESTFN + "1"),
+                        os.stat(support.TESTFN + "2")
                     ),
                     False
                 )
@@ -399,7 +399,7 @@ class PosixPathTest(unittest.TestCase):
                 os.symlink(ABSTFN+"1", ABSTFN)
                 self.assertEqual(realpath(ABSTFN), ABSTFN+"1")
             finally:
-                test_support.unlink(ABSTFN)
+                support.unlink(ABSTFN)
 
         def test_realpath_symlink_loops(self):
             # Bug #930024, return the path unchanged if we get into an infinite
@@ -419,9 +419,9 @@ class PosixPathTest(unittest.TestCase):
                 self.assertEqual(realpath(basename(ABSTFN)), ABSTFN)
             finally:
                 os.chdir(old_path)
-                test_support.unlink(ABSTFN)
-                test_support.unlink(ABSTFN+"1")
-                test_support.unlink(ABSTFN+"2")
+                support.unlink(ABSTFN)
+                support.unlink(ABSTFN+"1")
+                support.unlink(ABSTFN+"2")
 
         def test_realpath_resolve_parents(self):
             # We also need to resolve any symlinks in the parents of a relative
@@ -438,7 +438,7 @@ class PosixPathTest(unittest.TestCase):
                 self.assertEqual(realpath("a"), ABSTFN + "/y/a")
             finally:
                 os.chdir(old_path)
-                test_support.unlink(ABSTFN + "/k")
+                support.unlink(ABSTFN + "/k")
                 safe_rmdir(ABSTFN + "/y")
                 safe_rmdir(ABSTFN)
 
@@ -464,7 +464,7 @@ class PosixPathTest(unittest.TestCase):
                 self.assertEqual(realpath(basename(ABSTFN) + "/link-y/.."), ABSTFN + "/k")
             finally:
                 os.chdir(old_path)
-                test_support.unlink(ABSTFN + "/link-y")
+                support.unlink(ABSTFN + "/link-y")
                 safe_rmdir(ABSTFN + "/k/y")
                 safe_rmdir(ABSTFN + "/k")
                 safe_rmdir(ABSTFN)
@@ -485,7 +485,7 @@ class PosixPathTest(unittest.TestCase):
                 self.assertEqual(realpath(base + "link/k"), ABSTFN + "/k")
             finally:
                 os.chdir(old_path)
-                test_support.unlink(ABSTFN + "link")
+                support.unlink(ABSTFN + "link")
                 safe_rmdir(ABSTFN + "/k")
                 safe_rmdir(ABSTFN)
 
@@ -506,7 +506,7 @@ class PosixPathTest(unittest.TestCase):
             os.getcwd = real_getcwd
 
 def test_main():
-    test_support.run_unittest(PosixPathTest)
+    support.run_unittest(PosixPathTest)
 
 if __name__=="__main__":
     test_main()
index 9b358f1970e0b54f4c9b3ae65964d6ab3be5aed2..859c3737b9097322ffea755e21a64fa6687ef967 100644 (file)
@@ -1,4 +1,4 @@
-import test.test_support, unittest
+import test.support, unittest
 
 class PowTest(unittest.TestCase):
 
@@ -123,7 +123,7 @@ class PowTest(unittest.TestCase):
         eq(expected, 1.0)   # else we didn't push fiveto to evenness
 
 def test_main():
-    test.test_support.run_unittest(PowTest)
+    test.support.run_unittest(PowTest)
 
 if __name__ == "__main__":
     test_main()
index ed352877f527e7b5f75548ac3ae459dd2468b4b4..54c0c576069dfa1e85e207385bfe4026a215401e 100644 (file)
@@ -1,5 +1,5 @@
 import pprint
-import test.test_support
+import test.support
 import unittest
 import test.test_set
 
@@ -411,7 +411,7 @@ class DottedPrettyPrinter(pprint.PrettyPrinter):
 
 
 def test_main():
-    test.test_support.run_unittest(QueryTestCase)
+    test.support.run_unittest(QueryTestCase)
 
 
 if __name__ == "__main__":
index 58ca06988a083912a4e5f86a86a172c75641e540..f157bc7db639166c37ffb3e2fe4ad688ec2b2b2a 100644 (file)
@@ -6,7 +6,7 @@
 from __future__ import print_function
 
 import unittest
-from test import test_support
+from test import support
 
 import sys
 try:
@@ -62,7 +62,7 @@ class TestPrint(unittest.TestCase):
                        end is not NotDefined,
                        file is not NotDefined)]
 
-        with test_support.captured_stdout() as t:
+        with support.captured_stdout() as t:
             fn(args, sep, end, file)
 
         self.assertEqual(t.getvalue(), expected)
@@ -113,7 +113,7 @@ class TestPrint(unittest.TestCase):
         self.assertRaises(AttributeError, print, '', file='')
 
 def test_main():
-    test_support.run_unittest(TestPrint)
+    support.run_unittest(TestPrint)
 
 if __name__ == "__main__":
     test_main()
index 9fea434d86519388b0b4cd602a9a9cc1134d07fd..84167ddc216d30120d5183c0d863bf9c62fe1514 100755 (executable)
@@ -6,7 +6,7 @@ import pstats
 import unittest
 from difflib import unified_diff
 from io import StringIO
-from test.test_support import run_unittest
+from test.support import run_unittest
 
 import profile
 from test.profilee import testfunc, timer
index 6d6aa8e59453b451acb7d129ca1c3ff6d9dda184..296c997c53ee9702f5ad1d707a3c37feb3ad490d 100644 (file)
@@ -2,7 +2,7 @@ import pprint
 import sys
 import unittest
 
-from test import test_support
+from test import support
 
 class TestGetProfile(unittest.TestCase):
     def setUp(self):
@@ -357,7 +357,7 @@ def capture_events(callable, p=None):
     except TypeError:
         pass
     else:
-        raise test_support.TestFailed(
+        raise support.TestFailed(
             'sys.setprofile() did not raise TypeError')
 
     if p is None:
@@ -374,7 +374,7 @@ def show_events(callable):
 
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         TestGetProfile,
         ProfileHookTestCase,
         ProfileSimulatorTestCase
index 4b6e20caa3925848130612282f85a5c1177dd140..c957ec272c1dadb53e2f4bae2ba9554adf3090dd 100644 (file)
@@ -2,7 +2,7 @@
 # more tests are in test_descr
 
 import unittest
-from test.test_support import run_unittest
+from test.support import run_unittest
 
 class PropertyBase(Exception):
     pass
index 660316b19f001e17903f6adf926b7d95d05097e8..095123d881d185dbdad672e9a6e29dccf656adbf 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 import pstats
 
 
@@ -17,7 +17,7 @@ class AddCallersTestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         AddCallersTestCase
     )
 
index 58a304186f29d3a501a6e3593614bc884abffb8a..f62fc99fba49c18a89e8e90851ac3235177f5973 100644 (file)
@@ -4,7 +4,7 @@ import pty
 import os
 import sys
 import signal
-from test.test_support import verbose, TestSkipped, run_unittest
+from test.support import verbose, TestSkipped, run_unittest
 import unittest
 
 TEST_STRING_1 = "I wish to buy a fish license.\n"
index 19187a3d7413c0a62b66f44526b55bef26e76060..b5a5de79d777f6ea2c30bba4281034dd0b113dd1 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 
 import pwd
 
@@ -91,7 +91,7 @@ class PwdTest(unittest.TestCase):
         self.assertRaises(KeyError, pwd.getpwuid, fakeuid)
 
 def test_main():
-    test_support.run_unittest(PwdTest)
+    support.run_unittest(PwdTest)
 
 if __name__ == "__main__":
     test_main()
index 57ede896523b8a4d0e4f3148d09f163bfe260585..bcc16df16d1b6084b72a30caae4897b3a4a86488 100644 (file)
@@ -2,7 +2,7 @@
    Test cases for pyclbr.py
    Nick Mathewson
 '''
-from test.test_support import run_unittest
+from test.support import run_unittest
 import sys
 from types import FunctionType, MethodType, BuiltinFunctionType
 import pyclbr
index ba37ec12fe63739e48005b70047b9eaaefcd68ed..cc4a096f00d6e07ed720a0e1f9ebf3178cb6854f 100644 (file)
@@ -1,4 +1,4 @@
-from test import test_support\r
+from test import support\r
 import unittest\r
 import pydoc\r
 \r
@@ -19,7 +19,7 @@ class TestDescriptions(unittest.TestCase):
                         in pydoc.render_doc(c))\r
 \r
 def test_main():\r
-    test_support.run_unittest(TestDescriptions)\r
+    support.run_unittest(TestDescriptions)\r
 \r
 if __name__ == "__main__":\r
     unittest.main()\r
index 9fda72d18f2235bc64ecc31e5ce0e85e20989226..c252134b022796846ddcfbbfc8b4fbb718f51649 100644 (file)
@@ -8,7 +8,7 @@ import unittest
 import pyexpat
 from xml.parsers import expat
 
-from test.test_support import sortdict, run_unittest
+from test.support import sortdict, run_unittest
 
 
 class SetAttributeTest(unittest.TestCase):
index df7b7e34216e819401c0f0c20363b036c4237b52..6303117261dc0fbb6438b0afee57697b9deef679 100644 (file)
@@ -5,7 +5,7 @@ import sys
 import threading
 import time
 import unittest
-from test import test_support
+from test import support
 
 QUEUE_SIZE = 5
 
@@ -318,7 +318,7 @@ class FailingQueueTest(unittest.TestCase, BlockingTestMixin):
 
 
 def test_main():
-    test_support.run_unittest(QueueTest, LifoQueueTest, PriorityQueueTest,
+    support.run_unittest(QueueTest, LifoQueueTest, PriorityQueueTest,
                               FailingQueueTest)
 
 
index b9ad65be2856153fc2017c38eb2fe0ca63932541..2c52a3c025ad503b963633858ca1477ba7c7e57d 100644 (file)
@@ -1,4 +1,4 @@
-from test import test_support
+from test import support
 import unittest
 
 import sys, os, io, subprocess
@@ -199,7 +199,7 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
         self.assertEqual(cout.splitlines(), p.splitlines())
 
 def test_main():
-    test_support.run_unittest(QuopriTestCase)
+    support.run_unittest(QuopriTestCase)
 
 
 if __name__ == "__main__":
index 27a5cbcf65c19584696b4847a8765a53b524f825..89e219048b2ed3824b94aeb0fa37e9097ab389a5 100644 (file)
@@ -3,7 +3,7 @@
 
 """Tests for the raise statement."""
 
-from test import test_support
+from test import support
 import sys
 import types
 import unittest
@@ -156,7 +156,7 @@ class TestRemovedFunctionality(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 
 if __name__ == "__main__":
index c02eb092670146a80ceef89d99000719130b257e..04c49fa670674dd0d45a0d44ffe34dcd5372b818 100644 (file)
@@ -6,7 +6,7 @@ import time
 import pickle
 import warnings
 from math import log, exp, sqrt, pi
-from test import test_support
+from test import support
 
 class TestBasicOps(unittest.TestCase):
     # Superclass with tests common to all generators.
@@ -118,7 +118,7 @@ class TestBasicOps(unittest.TestCase):
                  ("randv2_64.pck", 866),
                  ("randv3.pck", 343)]
         for file, value in files:
-            f = open(test_support.findfile(file),"rb")
+            f = open(support.findfile(file),"rb")
             r = pickle.load(f)
             f.close()
             self.assertEqual(r.randrange(1000), value)
@@ -474,14 +474,14 @@ def test_main(verbose=None):
     else:
         testclasses.append(SystemRandom_TestBasicOps)
 
-    test_support.run_unittest(*testclasses)
+    support.run_unittest(*testclasses)
 
     # verify reference counting
     import sys
     if verbose and hasattr(sys, "gettotalrefcount"):
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_unittest(*testclasses)
+            support.run_unittest(*testclasses)
             counts[i] = sys.gettotalrefcount()
         print(counts)
 
index dedf007282c70972f209522dadb0ced54b617400..1fd8f1d14107ecbb5a004d46c6b3f2fa7ac31047 100644 (file)
@@ -1,6 +1,6 @@
 # Python test set -- built-in functions
 
-import test.test_support, unittest
+import test.support, unittest
 import sys
 
 import warnings
@@ -62,7 +62,7 @@ class RangeTest(unittest.TestCase):
         self.assertEqual(repr(range(1, 2, 3)), 'range(1, 2, 3)')
 
 def test_main():
-    test.test_support.run_unittest(RangeTest)
+    test.support.run_unittest(RangeTest)
 
 if __name__ == "__main__":
     test_main()
index 11677f35f5e7a265d18796062cbf423ad2bfa96a..0b023c2fb7958df69be3d658b7b9d29ee5b5bf7a 100644 (file)
@@ -1,7 +1,7 @@
 import sys
 sys.path = ['.'] + sys.path
 
-from test.test_support import verbose, run_unittest, catch_warning
+from test.support import verbose, run_unittest, catch_warning
 import re
 from re import Scanner
 import sys, os, traceback
index 442c0482c769f82e64c4ae810172c4989b7df338..8bd0ccf91125268065d89549de83137781cb6d40 100644 (file)
@@ -8,7 +8,7 @@ import os
 import shutil
 import unittest
 
-from test.test_support import run_unittest
+from test.support import run_unittest
 from reprlib import repr as r # Don't shadow builtin repr
 from reprlib import Repr
 
index b66caf81a384d4b3607ce90a4596256a54ae24d8..7063ff9c2a6a178f5e87a9a696cb12375a973185 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 
 import resource
 import time
@@ -47,7 +47,7 @@ class ResourceTest(unittest.TestCase):
                     limit_set = True
                 except ValueError:
                     limit_set = False
-                f = open(test_support.TESTFN, "wb")
+                f = open(support.TESTFN, "wb")
                 try:
                     f.write(b"X" * 1024)
                     try:
@@ -73,7 +73,7 @@ class ResourceTest(unittest.TestCase):
             finally:
                 if limit_set:
                     resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max))
-                test_support.unlink(test_support.TESTFN)
+                support.unlink(support.TESTFN)
 
     def test_fsize_toobig(self):
         # Be sure that setrlimit is checking for really large values
@@ -104,7 +104,7 @@ class ResourceTest(unittest.TestCase):
             pass
 
 def test_main(verbose=None):
-    test_support.run_unittest(ResourceTest)
+    support.run_unittest(ResourceTest)
 
 if __name__ == "__main__":
     test_main()
index 1f5dd64190b5791bfdf8f0638041c640b371e169..d2883e96d362e26c85a536eae9f8f9bde21658e2 100644 (file)
@@ -1,6 +1,6 @@
 import rfc822
 import unittest
-from test import test_support
+from test import support
 
 try:
     from io import StringIO
@@ -249,7 +249,7 @@ A test message.
 
 
 def test_main():
-    test_support.run_unittest(MessageTestCase)
+    support.run_unittest(MessageTestCase)
 
 
 if __name__ == "__main__":
index 7b6f9be254368757d89e4b1317224352331be882..30dac8f91755d0e0a1ebfbd3495c5e8d5a42932a 100644 (file)
@@ -1,7 +1,7 @@
 # Tests for rich comparisons
 
 import unittest
-from test import test_support
+from test import support
 
 import operator
 
@@ -29,7 +29,7 @@ class Number:
         return self.x >= other
 
     def __cmp__(self, other):
-        raise test_support.TestFailed("Number.__cmp__() should not be called")
+        raise support.TestFailed("Number.__cmp__() should not be called")
 
     def __repr__(self):
         return "Number(%r)" % (self.x, )
@@ -55,7 +55,7 @@ class Vector:
         raise TypeError("Vectors cannot be used in Boolean contexts")
 
     def __cmp__(self, other):
-        raise test_support.TestFailed("Vector.__cmp__() should not be called")
+        raise support.TestFailed("Vector.__cmp__() should not be called")
 
     def __repr__(self):
         return "Vector(%r)" % (self.data, )
@@ -387,11 +387,11 @@ class HashableTest(unittest.TestCase):
             self.assertEquals(str(e),
                               "unhashable type: 'DumbEqualityWithoutHash'")
         else:
-            raise test_support.TestFailed("Should not be here")
+            raise support.TestFailed("Should not be here")
 
 
 def test_main():
-    test_support.run_unittest(VectorTest, NumberTest, MiscTest, DictTest, ListTest, HashableTest)
+    support.run_unittest(VectorTest, NumberTest, MiscTest, DictTest, ListTest, HashableTest)
 
 if __name__ == "__main__":
     test_main()
index ad66b69490fdcd4f49eb25753e196daa374ad8d0..4e530f0d3d874330face0e6fd80d83f296be2733 100644 (file)
@@ -1,6 +1,6 @@
 import unittest, robotparser
 import io
-from test import test_support
+from test import support
 
 class RobotTestCase(unittest.TestCase):
     def __init__(self, index, parser, url, good, agent):
@@ -137,7 +137,7 @@ RobotTest(7, doc, good, bad)
 
 class TestCase(unittest.TestCase):
     def runTest(self):
-        test_support.requires('network')
+        support.requires('network')
         # whole site is password-protected.
         url = 'http://mueblesmoraleda.com'
         parser = robotparser.RobotFileParser()
@@ -146,9 +146,9 @@ class TestCase(unittest.TestCase):
         self.assertEqual(parser.can_fetch("*", url+"/robots.txt"), False)
 
 def test_main():
-    test_support.run_unittest(tests)
+    support.run_unittest(tests)
     TestCase().run()
 
 if __name__=='__main__':
-    test_support.Verbose = 1
+    support.Verbose = 1
     test_main()
index ffa36dc75b1190ddf66e5fa4e06a9b6a2f66e640..43691cbbb673428baaf1a29d5600a4bcbacd05d0 100644 (file)
@@ -4,7 +4,7 @@ import os
 import os.path
 import sys
 import tempfile
-from test.test_support import verbose, run_unittest, forget
+from test.support import verbose, run_unittest, forget
 from runpy import _run_code, _run_module_code, run_module
 
 # Note: This module can't safely test _run_module_as_main as it
index eb795813ae77e0233e770340a5597d9b73b2f980..5f1a48ed48e7885040e98608c6d63ae51e55b55e 100644 (file)
@@ -13,7 +13,7 @@ from xml.sax.saxutils import XMLGenerator, escape, unescape, quoteattr, \
 from xml.sax.expatreader import create_parser
 from xml.sax.xmlreader import InputSource, AttributesImpl, AttributesNSImpl
 from io import StringIO
-from test.test_support import findfile, run_unittest
+from test.support import findfile, run_unittest
 import unittest
 import os
 
index c18445df50f96b59e5d45bae93bd092937364119..a3f1d4a50dd3372fd1608765980b15d347f83c83 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test.test_support import check_syntax_error, run_unittest
+from test.support import check_syntax_error, run_unittest
 
 import warnings
 warnings.filterwarnings("ignore", r"import \*", SyntaxWarning, "<test string>")
index f4032d1c0c15b277d46dae14fc91be1392223ed2..a463868f6278d49eddbacb957d79b74426e65ddb 100644 (file)
@@ -1,4 +1,4 @@
-from test import test_support
+from test import support
 import unittest
 import select
 import os
@@ -21,23 +21,23 @@ class SelectTestCase(unittest.TestCase):
 
     def test_select(self):
         if sys.platform[:3] in ('win', 'mac', 'os2', 'riscos'):
-            if test_support.verbose:
+            if support.verbose:
                 print("Can't test select easily on", sys.platform)
             return
         cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done'
         p = os.popen(cmd, 'r')
         for tout in (0, 1, 2, 4, 8, 16) + (None,)*10:
-            if test_support.verbose:
+            if support.verbose:
                 print('timeout =', tout)
             rfd, wfd, xfd = select.select([p], [], [], tout)
             if (rfd, wfd, xfd) == ([], [], []):
                 continue
             if (rfd, wfd, xfd) == ([p], [], []):
                 line = p.readline()
-                if test_support.verbose:
+                if support.verbose:
                     print(repr(line))
                 if not line:
-                    if test_support.verbose:
+                    if support.verbose:
                         print('EOF')
                     break
                 continue
@@ -45,8 +45,8 @@ class SelectTestCase(unittest.TestCase):
         p.close()
 
 def test_main():
-    test_support.run_unittest(SelectTestCase)
-    test_support.reap_children()
+    support.run_unittest(SelectTestCase)
+    support.reap_children()
 
 if __name__ == "__main__":
     test_main()
index 44a45afa60aba783286c26ed5740d0dbe5e4fb66..d05df3f24dec382fa0ea3c58c1d1cf6c3694d764 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 from weakref import proxy
 import operator
 import copy
@@ -288,14 +288,14 @@ class TestJointOps(unittest.TestCase):
         s = self.thetype([w])
         w.value = s
         try:
-            fo = open(test_support.TESTFN, "w")
+            fo = open(support.TESTFN, "w")
             fo.write(str(s))
             fo.close()
-            fo = open(test_support.TESTFN, "r")
+            fo = open(support.TESTFN, "r")
             self.assertEqual(fo.read(), repr(s))
         finally:
             fo.close()
-            test_support.unlink(test_support.TESTFN)
+            support.unlink(support.TESTFN)
 
     def test_do_not_rehash_dict_keys(self):
         n = 10
@@ -672,14 +672,14 @@ class TestBasicOps(unittest.TestCase):
 
     def test_print(self):
         try:
-            fo = open(test_support.TESTFN, "w")
+            fo = open(support.TESTFN, "w")
             fo.write(str(self.set))
             fo.close()
-            fo = open(test_support.TESTFN, "r")
+            fo = open(support.TESTFN, "r")
             self.assertEqual(fo.read(), repr(self.set))
         finally:
             fo.close()
-            test_support.unlink(test_support.TESTFN)
+            support.unlink(support.TESTFN)
 
     def test_length(self):
         self.assertEqual(len(self.set), self.length)
@@ -1752,14 +1752,14 @@ def test_main(verbose=None):
         TestGraphs,
         )
 
-    test_support.run_unittest(*test_classes)
+    support.run_unittest(*test_classes)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_unittest(*test_classes)
+            support.run_unittest(*test_classes)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
index f3822930285a93f391d2dd68b5b11e8e30205ce5..fb7cde03d782364ea368efa8232820815a1c7f2d 100644 (file)
@@ -133,16 +133,16 @@ __test__ = {'doctests' : doctests}
 
 def test_main(verbose=None):
     import sys
-    from test import test_support
+    from test import support
     from test import test_setcomps
-    test_support.run_doctest(test_setcomps, verbose)
+    support.run_doctest(test_setcomps, verbose)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_doctest(test_setcomps, verbose)
+            support.run_doctest(test_setcomps, verbose)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
index 374b92130083eab434122bf3ab1d302d501a87fd..60158785f309da77ea36e0c86a64d84dd7cd2d2c 100644 (file)
@@ -2,7 +2,7 @@ import pprint
 import re
 import sgmllib
 import unittest
-from test import test_support
+from test import support
 
 
 class EventCollector(sgmllib.SGMLParser):
@@ -365,7 +365,7 @@ DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN'
         # Just verify this code doesn't cause a hang.
         CHUNK = 1024  # increasing this to 8212 makes the problem go away
 
-        f = open(test_support.findfile('sgml_input.html'), encoding="latin-1")
+        f = open(support.findfile('sgml_input.html'), encoding="latin-1")
         fp = sgmllib.SGMLParser()
         while 1:
             data = f.read(CHUNK)
@@ -431,7 +431,7 @@ DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN'
 
 
 def test_main():
-    test_support.run_unittest(SGMLParserTestCase)
+    support.run_unittest(SGMLParserTestCase)
 
 
 if __name__ == "__main__":
index 6d917ff52256cb512445516ebaab13dec0372462..5fb4641e7c7c5152d2338051ba1b131748a09520 100644 (file)
@@ -1,7 +1,7 @@
 import unittest
 import shelve
 import glob
-from test import test_support
+from test import support
 from collections import MutableMapping
 from test.test_anydbm import dbm_iterator
 
@@ -45,7 +45,7 @@ class TestCase(unittest.TestCase):
 
     def tearDown(self):
         for f in glob.glob(self.fn+"*"):
-            test_support.unlink(f)
+            support.unlink(f)
 
     def test_ascii_file_shelf(self):
         s = shelve.open(self.fn, protocol=0)
@@ -133,7 +133,7 @@ class TestShelveBase(mapping_tests.BasicTestMappingProtocol):
         self._db = []
         if not self._in_mem:
             for f in glob.glob(self.fn+"*"):
-                test_support.unlink(f)
+                support.unlink(f)
 
 class TestAsciiFileShelve(TestShelveBase):
     _args={'protocol':0}
@@ -156,7 +156,7 @@ class TestProto2MemShelve(TestShelveBase):
 
 def test_main():
     for module in dbm_iterator():
-        test_support.run_unittest(
+        support.run_unittest(
             TestAsciiFileShelve,
             TestBinaryFileShelve,
             TestProto2FileShelve,
index b18155e165a0cbcba726c0351ae9403f3fb7142d..1685938d79eac587a72fbfd2b7e5b94fbe790b48 100644 (file)
@@ -3,7 +3,7 @@ import unittest
 import os, sys, io
 import shlex
 
-from test import test_support
+from test import support
 
 
 # The original test data set was from shellwords, by Hartmut Goebel.
@@ -181,7 +181,7 @@ if not getattr(shlex, "split", None):
             delattr(ShlexTest, methname)
 
 def test_main():
-    test_support.run_unittest(ShlexTest)
+    support.run_unittest(ShlexTest)
 
 if __name__ == "__main__":
     test_main()
index 2a316b2d5a54beb1fe0a71eff665d6da5c971f29..2e680a90d354200d98c43261a9ca9a0e296dec41 100644 (file)
@@ -7,8 +7,8 @@ import sys
 import stat
 import os
 import os.path
-from test import test_support
-from test.test_support import TESTFN
+from test import support
+from test.support import TESTFN
 
 class TestShutil(unittest.TestCase):
     def test_rmtree_errors(self):
@@ -267,7 +267,7 @@ class TestMove(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(TestShutil, TestMove)
+    support.run_unittest(TestShutil, TestMove)
 
 if __name__ == '__main__':
     test_main()
index 339cec216e056b6e69181c099d8f8a9c3ba0158d..b8ac2ccc11cc5008a49b1795c4a51a328cdd578c 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 from contextlib import closing, nested
 import gc
 import pickle
@@ -10,7 +10,7 @@ import traceback
 import sys, os, time, errno
 
 if sys.platform[:3] in ('win', 'os2') or sys.platform == 'riscos':
-    raise test_support.TestSkipped("Can't test signal on %s" % \
+    raise support.TestSkipped("Can't test signal on %s" % \
                                    sys.platform)
 
 
@@ -53,13 +53,13 @@ class InterProcessSignalTests(unittest.TestCase):
 
     def handlerA(self, signum, frame):
         self.a_called = True
-        if test_support.verbose:
+        if support.verbose:
             print("handlerA invoked from signal %s at:\n%s" % (
                 signum, self.format_frame(frame, limit=1)))
 
     def handlerB(self, signum, frame):
         self.b_called = True
-        if test_support.verbose:
+        if support.verbose:
             print ("handlerB invoked from signal %s at:\n%s" % (
                 signum, self.format_frame(frame, limit=1)))
         raise HandlerBCalled(signum, self.format_frame(frame))
@@ -88,7 +88,7 @@ class InterProcessSignalTests(unittest.TestCase):
 
         # Let the sub-processes know who to send signals to.
         pid = os.getpid()
-        if test_support.verbose:
+        if support.verbose:
             print("test runner's pid is", pid)
 
         child = ignoring_eintr(subprocess.Popen, ['kill', '-HUP', str(pid)])
@@ -113,7 +113,7 @@ class InterProcessSignalTests(unittest.TestCase):
         except HandlerBCalled:
             self.assertTrue(self.b_called)
             self.assertFalse(self.a_called)
-            if test_support.verbose:
+            if support.verbose:
                 print("HandlerBCalled exception caught")
 
         child = ignoring_eintr(subprocess.Popen, ['kill', '-USR2', str(pid)])
@@ -130,7 +130,7 @@ class InterProcessSignalTests(unittest.TestCase):
             # may return early.
             time.sleep(1)
         except KeyboardInterrupt:
-            if test_support.verbose:
+            if support.verbose:
                 print("KeyboardInterrupt (the alarm() went off)")
         except:
             self.fail("Some other exception woke us from pause: %s" %
@@ -309,7 +309,7 @@ class ItimerTest(unittest.TestCase):
 
     def sig_alrm(self, *args):
         self.hndl_called = True
-        if test_support.verbose:
+        if support.verbose:
             print("SIGALRM handler invoked", args)
 
     def sig_vtalrm(self, *args):
@@ -322,19 +322,19 @@ class ItimerTest(unittest.TestCase):
         elif self.hndl_count == 3:
             # disable ITIMER_VIRTUAL, this function shouldn't be called anymore
             signal.setitimer(signal.ITIMER_VIRTUAL, 0)
-            if test_support.verbose:
+            if support.verbose:
                 print("last SIGVTALRM handler call")
 
         self.hndl_count += 1
 
-        if test_support.verbose:
+        if support.verbose:
             print("SIGVTALRM handler invoked", args)
 
     def sig_prof(self, *args):
         self.hndl_called = True
         signal.setitimer(signal.ITIMER_PROF, 0)
 
-        if test_support.verbose:
+        if support.verbose:
             print("SIGPROF handler invoked", args)
 
     def test_itimer_exc(self):
@@ -349,7 +349,7 @@ class ItimerTest(unittest.TestCase):
     def test_itimer_real(self):
         self.itimer = signal.ITIMER_REAL
         signal.setitimer(self.itimer, 1.0)
-        if test_support.verbose:
+        if support.verbose:
             print("\ncall pause()...")
         signal.pause()
 
@@ -384,7 +384,7 @@ class ItimerTest(unittest.TestCase):
         self.assertEqual(self.hndl_called, True)
 
 def test_main():
-    test_support.run_unittest(BasicSignalTests, InterProcessSignalTests,
+    support.run_unittest(BasicSignalTests, InterProcessSignalTests,
         WakeupSignalTests, SiginterruptTest, ItimerTest)
 
 
index a13751c56fe7de8b4c6bff26edcc1c9dd3b2c1fb..3f93a38fa43e0b637ef5dba30f85c2e425d69551 100644 (file)
@@ -5,7 +5,7 @@ executing have not been removed.
 
 """
 import unittest
-from test.test_support import TestSkipped, run_unittest, TESTFN
+from test.support import TestSkipped, run_unittest, TESTFN
 import builtins
 import os
 import sys
index 20d2027028888a60f57a83cd7640edcbfdb057a7..e61974658c990c81383a0c25a9b5c37e0e0d5070 100644 (file)
@@ -1,7 +1,7 @@
 # tests for slice objects; in particular the indices method.
 
 import unittest
-from test import test_support
+from test import support
 from pickle import loads, dumps
 
 import sys
@@ -115,7 +115,7 @@ class SliceTest(unittest.TestCase):
             self.assertNotEqual(id(s), id(t))
 
 def test_main():
-    test_support.run_unittest(SliceTest)
+    support.run_unittest(SliceTest)
 
 if __name__ == "__main__":
     test_main()
index 9dc672d5ac41e829d5d6f70c1a734a46a4f2eca4..3d38d89d2702f42b4e08f0909b96fa94c049a1ae 100644 (file)
@@ -10,9 +10,9 @@ import time
 import select
 
 from unittest import TestCase
-from test import test_support
+from test import support
 
-HOST = test_support.HOST
+HOST = support.HOST
 
 def server(evt, buf, serv):
     serv.listen(5)
@@ -42,7 +42,7 @@ class GeneralTests(TestCase):
         self.evt = threading.Event()
         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         self.sock.settimeout(15)
-        self.port = test_support.bind_port(self.sock)
+        self.port = support.bind_port(self.sock)
         servargs = (self.evt, b"220 Hola mundo\n", self.sock)
         threading.Thread(target=server, args=servargs).start()
         self.evt.wait()
@@ -142,7 +142,7 @@ class DebuggingServerTests(TestCase):
 
         self.serv_evt = threading.Event()
         self.client_evt = threading.Event()
-        self.port = test_support.find_unused_port()
+        self.port = support.find_unused_port()
         self.serv = smtpd.DebuggingServer((HOST, self.port), ('nowhere', -1))
         serv_args = (self.serv, self.serv_evt, self.client_evt)
         threading.Thread(target=debugging_server, args=serv_args).start()
@@ -250,7 +250,7 @@ class BadHELOServerTests(TestCase):
         self.evt = threading.Event()
         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         self.sock.settimeout(15)
-        self.port = test_support.bind_port(self.sock)
+        self.port = support.bind_port(self.sock)
         servargs = (self.evt, b"199 no hello for you!\n", self.sock)
         threading.Thread(target=server, args=servargs).start()
         self.evt.wait()
@@ -327,7 +327,7 @@ class SMTPSimTests(TestCase):
     def setUp(self):
         self.serv_evt = threading.Event()
         self.client_evt = threading.Event()
-        self.port = test_support.find_unused_port()
+        self.port = support.find_unused_port()
         self.serv = SimSMTPServer((HOST, self.port), ('nowhere', -1))
         serv_args = (self.serv, self.serv_evt, self.client_evt)
         threading.Thread(target=debugging_server, args=serv_args).start()
@@ -401,7 +401,7 @@ class SMTPSimTests(TestCase):
 
 
 def test_main(verbose=None):
-    test_support.run_unittest(GeneralTests, DebuggingServerTests,
+    support.run_unittest(GeneralTests, DebuggingServerTests,
                               NonConnectingTests,
                               BadHELOServerTests, SMTPSimTests)
 
index ab860ddf80e62a5677abc20917ff5139a2f4ee14..349548f7173c6f49c12e96d8d303b8b3867cff30 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 import unittest
-from test import test_support
+from test import support
 
 import errno
 import socket
@@ -16,14 +16,14 @@ import array
 from weakref import proxy
 import signal
 
-HOST = test_support.HOST
+HOST = support.HOST
 MSG = b'Michael Gilfix was here\n'
 
 class SocketTCPTest(unittest.TestCase):
 
     def setUp(self):
         self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-        self.port = test_support.bind_port(self.serv)
+        self.port = support.bind_port(self.serv)
         self.serv.listen(1)
 
     def tearDown(self):
@@ -34,7 +34,7 @@ class SocketUDPTest(unittest.TestCase):
 
     def setUp(self):
         self.serv = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
-        self.port = test_support.bind_port(self.serv)
+        self.port = support.bind_port(self.serv)
 
     def tearDown(self):
         self.serv.close()
@@ -898,7 +898,7 @@ class BasicTCPTest2(NetworkConnectionTest, BasicTCPTest):
 class NetworkConnectionNoServer(unittest.TestCase):
 
     def testWithoutServer(self):
-        port = test_support.find_unused_port()
+        port = support.find_unused_port()
         self.failUnlessRaises(
             socket.error,
             lambda: socket.create_connection((HOST, port))
@@ -1145,7 +1145,7 @@ def isTipcAvailable():
         for line in f:
             if line.startswith("tipc "):
                 return True
-    if test_support.verbose:
+    if support.verbose:
         print("TIPC module is not loaded, please 'sudo modprobe tipc'")
     return False
 
@@ -1229,9 +1229,9 @@ def test_main():
         tests.append(TIPCTest)
         tests.append(TIPCThreadableTest)
 
-    thread_info = test_support.threading_setup()
-    test_support.run_unittest(*tests)
-    test_support.threading_cleanup(*thread_info)
+    thread_info = support.threading_setup()
+    support.run_unittest(*tests)
+    support.threading_cleanup(*thread_info)
 
 if __name__ == "__main__":
     test_main()
index b6bb0f70ecbc3c3f76c93137e5067d882679bc0d..5b733ae401e20f9cfb9039ea2a089cc23631e96b 100644 (file)
@@ -15,14 +15,14 @@ import time
 import unittest
 import socketserver
 
-import test.test_support
-from test.test_support import reap_children, verbose, TestSkipped
-from test.test_support import TESTFN as TEST_FILE
+import test.support
+from test.support import reap_children, verbose, TestSkipped
+from test.support import TESTFN as TEST_FILE
 
-test.test_support.requires("network")
+test.support.requires("network")
 
 TEST_STR = b"hello world\n"
-HOST = test.test_support.HOST
+HOST = test.support.HOST
 
 HAVE_UNIX_SOCKETS = hasattr(socket, "AF_UNIX")
 HAVE_FORKING = hasattr(os, "fork") and os.name != "os2"
@@ -249,7 +249,7 @@ def test_main():
         # If the import lock is held, the threads will hang
         raise TestSkipped("can't run when import lock is held")
 
-    test.test_support.run_unittest(SocketServerTest)
+    test.support.run_unittest(SocketServerTest)
 
 if __name__ == "__main__":
     test_main()
index 8301c319e9534cb638fc329c749aab1ef677420e..8b108d59a3c154b47c0849c012d225b335b35933 100644 (file)
@@ -1,9 +1,9 @@
-from test import test_support
+from test import support
 import random
 import sys
 import unittest
 
-verbose = test_support.verbose
+verbose = support.verbose
 nerrors = 0
 
 def CmpToKey(mycmp):
@@ -261,14 +261,14 @@ def test_main(verbose=None):
         TestBugs,
     )
 
-    test_support.run_unittest(*test_classes)
+    support.run_unittest(*test_classes)
 
     # verify reference counting
     if verbose and hasattr(sys, "gettotalrefcount"):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
-            test_support.run_unittest(*test_classes)
+            support.run_unittest(*test_classes)
             gc.collect()
             counts[i] = sys.gettotalrefcount()
         print(counts)
index 945dd511b89b052e73cbe323d6a413f88e6860c8..b8a9acff7859e3763a2e6dc108de6e0264b3978f 100644 (file)
@@ -1,4 +1,4 @@
-from test.test_support import run_unittest, TestSkipped
+from test.support import run_unittest, TestSkipped
 
 try:
     import _sqlite3
index 59bf57dd4d69f5b348bebc3e81650e1e895f2b6c..4f884f0381f3d175f0d4011d073dad1f8f56f9c3 100644 (file)
@@ -2,7 +2,7 @@
 
 import sys
 import unittest
-from test import test_support
+from test import support
 import socket
 import select
 import errno
@@ -25,27 +25,27 @@ try:
 except ImportError:
     skip_expected = True
 
-HOST = test_support.HOST
+HOST = support.HOST
 CERTFILE = None
 SVN_PYTHON_ORG_ROOT_CERT = None
 
 def handle_error(prefix):
     exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
-    if test_support.verbose:
+    if support.verbose:
         sys.stdout.write(prefix + exc_format)
 
 
 class BasicTests(unittest.TestCase):
 
     def testSSLconnect(self):
-        if not test_support.is_resource_enabled('network'):
+        if not support.is_resource_enabled('network'):
             return
         s = ssl.wrap_socket(socket.socket(socket.AF_INET),
                             cert_reqs=ssl.CERT_NONE)
         s.connect(("svn.python.org", 443))
         c = s.getpeercert()
         if c:
-            raise test_support.TestFailed("Peer cert %s shouldn't be here!")
+            raise support.TestFailed("Peer cert %s shouldn't be here!")
         s.close()
 
         # this should fail because we have no verification certs
@@ -69,7 +69,7 @@ class BasicTests(unittest.TestCase):
 
     def testRAND(self):
         v = ssl.RAND_status()
-        if test_support.verbose:
+        if support.verbose:
             sys.stdout.write("\n RAND_status is %d (%s)\n"
                              % (v, (v and "sufficient randomness") or
                                 "insufficient randomness"))
@@ -86,7 +86,7 @@ class BasicTests(unittest.TestCase):
         # provided solely for this test, to exercise the certificate
         # parsing code
         p = ssl._ssl._test_decode_cert(CERTFILE, False)
-        if test_support.verbose:
+        if support.verbose:
             sys.stdout.write("\n" + pprint.pformat(p) + "\n")
 
     def testDERtoPEM(self):
@@ -96,7 +96,7 @@ class BasicTests(unittest.TestCase):
         p2 = ssl.DER_cert_to_PEM_cert(d1)
         d2 = ssl.PEM_cert_to_DER_cert(p2)
         if (d1 != d2):
-            raise test_support.TestFailed("PEM-to-DER or DER-to-PEM translation failed")
+            raise support.TestFailed("PEM-to-DER or DER-to-PEM translation failed")
 
 class NetworkedTests(unittest.TestCase):
 
@@ -106,7 +106,7 @@ class NetworkedTests(unittest.TestCase):
         s.connect(("svn.python.org", 443))
         c = s.getpeercert()
         if c:
-            raise test_support.TestFailed("Peer cert %s shouldn't be here!")
+            raise support.TestFailed("Peer cert %s shouldn't be here!")
         s.close()
 
         # this should fail because we have no verification certs
@@ -126,7 +126,7 @@ class NetworkedTests(unittest.TestCase):
         try:
             s.connect(("svn.python.org", 443))
         except ssl.SSLError as x:
-            raise test_support.TestFailed("Unexpected exception %s" % x)
+            raise support.TestFailed("Unexpected exception %s" % x)
         finally:
             s.close()
 
@@ -151,14 +151,14 @@ class NetworkedTests(unittest.TestCase):
                 else:
                     raise
         s.close()
-        if test_support.verbose:
+        if support.verbose:
             sys.stdout.write("\nNeeded %d calls to do_handshake() to establish session.\n" % count)
 
     def testFetchServerCert(self):
 
         pem = ssl.get_server_certificate(("svn.python.org", 443))
         if not pem:
-            raise test_support.TestFailed("No server certificate on svn.python.org:443!")
+            raise support.TestFailed("No server certificate on svn.python.org:443!")
 
         return
 
@@ -166,15 +166,15 @@ class NetworkedTests(unittest.TestCase):
             pem = ssl.get_server_certificate(("svn.python.org", 443), ca_certs=CERTFILE)
         except ssl.SSLError as x:
             #should fail
-            if test_support.verbose:
+            if support.verbose:
                 sys.stdout.write("%s\n" % x)
         else:
-            raise test_support.TestFailed("Got server certificate %s for svn.python.org!" % pem)
+            raise support.TestFailed("Got server certificate %s for svn.python.org!" % pem)
 
         pem = ssl.get_server_certificate(("svn.python.org", 443), ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
         if not pem:
-            raise test_support.TestFailed("No server certificate on svn.python.org:443!")
-        if test_support.verbose:
+            raise support.TestFailed("No server certificate on svn.python.org:443!")
+        if support.verbose:
             sys.stdout.write("\nVerified certificate for svn.python.org:443 is\n%s\n" % pem)
 
 
@@ -227,13 +227,13 @@ else:
                 else:
                     if self.server.certreqs == ssl.CERT_REQUIRED:
                         cert = self.sslconn.getpeercert()
-                        if test_support.verbose and self.server.chatty:
+                        if support.verbose and self.server.chatty:
                             sys.stdout.write(" client cert is " + pprint.pformat(cert) + "\n")
                         cert_binary = self.sslconn.getpeercert(True)
-                        if test_support.verbose and self.server.chatty:
+                        if support.verbose and self.server.chatty:
                             sys.stdout.write(" cert binary is " + str(len(cert_binary)) + " bytes\n")
                     cipher = self.sslconn.cipher()
-                    if test_support.verbose and self.server.chatty:
+                    if support.verbose and self.server.chatty:
                         sys.stdout.write(" server: connection cipher is now " + str(cipher) + "\n")
                     return True
 
@@ -269,19 +269,19 @@ else:
                             self.running = False
                             self.close()
                         elif amsg.strip() == 'over':
-                            if test_support.verbose and self.server.connectionchatty:
+                            if support.verbose and self.server.connectionchatty:
                                 sys.stdout.write(" server: client closed connection\n")
                             self.close()
                             return
                         elif (self.server.starttls_server and
                               amsg.strip() == 'STARTTLS'):
-                            if test_support.verbose and self.server.connectionchatty:
+                            if support.verbose and self.server.connectionchatty:
                                 sys.stdout.write(" server: read STARTTLS from client, sending OK...\n")
                             self.write("OK\n".encode("ASCII", "strict"))
                             if not self.wrap_conn():
                                 return
                         else:
-                            if (test_support.verbose and
+                            if (support.verbose and
                                 self.server.connectionchatty):
                                 ctype = (self.sslconn and "encrypted") or "unencrypted"
                                 sys.stdout.write(" server: read %s (%s), sending back %s (%s)...\n"
@@ -314,7 +314,7 @@ else:
             self.connectionchatty = connectionchatty
             self.starttls_server = starttls_server
             self.sock = socket.socket()
-            self.port = test_support.bind_port(self.sock)
+            self.port = support.bind_port(self.sock)
             self.flag = None
             self.active = False
             threading.Thread.__init__(self)
@@ -334,7 +334,7 @@ else:
             while self.active:
                 try:
                     newconn, connaddr = self.sock.accept()
-                    if test_support.verbose and self.chatty:
+                    if support.verbose and self.chatty:
                         sys.stdout.write(' server:  new connection from '
                                          + repr(connaddr) + '\n')
                     handler = self.ConnectionHandler(self, newconn, connaddr)
@@ -457,7 +457,7 @@ else:
 
                 # we override this to suppress logging unless "verbose"
 
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write(" server (%s:%d %s):\n   [%s] %s\n" %
                                      (self.server.server_address,
                                       self.server.server_port,
@@ -470,7 +470,7 @@ else:
             self.flag = None
             self.active = False
             self.RootedHTTPRequestHandler.root = os.path.split(CERTFILE)[0]
-            self.port = test_support.find_unused_port()
+            self.port = support.find_unused_port()
             self.server = self.HTTPSServer(
                 (HOST, self.port), self.RootedHTTPRequestHandler, certfile)
             threading.Thread.__init__(self)
@@ -522,7 +522,7 @@ else:
 
                 def handle_read(self):
                     data = self.recv(1024)
-                    if test_support.verbose:
+                    if support.verbose:
                         sys.stdout.write(" server:  read %s from client\n" % repr(data))
                     if not data:
                         self.close()
@@ -530,7 +530,7 @@ else:
                         self.send(str(data, 'ASCII', 'strict').lower().encode('ASCII', 'strict'))
 
                 def handle_close(self):
-                    if test_support.verbose:
+                    if support.verbose:
                         sys.stdout.write(" server:  closed connection %s\n" % self.socket)
 
                 def handle_error(self):
@@ -546,7 +546,7 @@ else:
 
             def handle_accept(self):
                 sock_obj, addr = self.accept()
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write(" server:  new connection from %s:%s\n" %addr)
                 self.ConnectionHandler(sock_obj, self.certfile)
 
@@ -556,7 +556,7 @@ else:
         def __init__(self, certfile):
             self.flag = None
             self.active = False
-            self.port = test_support.find_unused_port()
+            self.port = support.find_unused_port()
             self.server = self.EchoServer(self.port, certfile)
             threading.Thread.__init__(self)
             self.setDaemon(True)
@@ -599,10 +599,10 @@ else:
                                     ssl_version=ssl.PROTOCOL_TLSv1)
                 s.connect((HOST, server.port))
             except ssl.SSLError as x:
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write("\nSSLError is %s\n" % x)
             else:
-                raise test_support.TestFailed(
+                raise support.TestFailed(
                     "Use of invalid cert should have failed!")
         finally:
             server.stop()
@@ -635,28 +635,28 @@ else:
                                 ssl_version=client_protocol)
             s.connect((HOST, server.port))
         except ssl.SSLError as x:
-            raise test_support.TestFailed("Unexpected SSL error:  " + str(x))
+            raise support.TestFailed("Unexpected SSL error:  " + str(x))
         except Exception as x:
-            raise test_support.TestFailed("Unexpected exception:  " + str(x))
+            raise support.TestFailed("Unexpected exception:  " + str(x))
         else:
             if connectionchatty:
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write(
                         " client:  sending %s...\n" % (repr(indata)))
             s.write(indata.encode('ASCII', 'strict'))
             outdata = s.read()
             if connectionchatty:
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write(" client:  read %s\n" % repr(outdata))
             outdata = str(outdata, 'ASCII', 'strict')
             if outdata != indata.lower():
-                raise test_support.TestFailed(
+                raise support.TestFailed(
                     "bad data <<%s>> (%d) received; expected <<%s>> (%d)\n"
                     % (repr(outdata[:min(len(outdata),20)]), len(outdata),
                        repr(indata[:min(len(indata),20)].lower()), len(indata)))
             s.write("over\n".encode("ASCII", "strict"))
             if connectionchatty:
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write(" client:  closing connection.\n")
             s.close()
         finally:
@@ -677,7 +677,7 @@ else:
             certtype = "CERT_OPTIONAL"
         elif certsreqs == ssl.CERT_REQUIRED:
             certtype = "CERT_REQUIRED"
-        if test_support.verbose:
+        if support.verbose:
             formatstr = (expectedToWork and " %s->%s %s\n") or " {%s->%s} %s\n"
             sys.stdout.write(formatstr %
                              (ssl.get_protocol_name(client_protocol),
@@ -687,12 +687,12 @@ else:
             serverParamsTest(CERTFILE, server_protocol, certsreqs,
                              CERTFILE, CERTFILE, client_protocol,
                              chatty=False, connectionchatty=False)
-        except test_support.TestFailed:
+        except support.TestFailed:
             if expectedToWork:
                 raise
         else:
             if not expectedToWork:
-                raise test_support.TestFailed(
+                raise support.TestFailed(
                     "Client protocol %s succeeded with server protocol %s!"
                     % (ssl.get_protocol_name(client_protocol),
                        ssl.get_protocol_name(server_protocol)))
@@ -702,7 +702,7 @@ else:
 
         def testEcho (self):
 
-            if test_support.verbose:
+            if support.verbose:
                 sys.stdout.write("\n")
             serverParamsTest(CERTFILE, ssl.PROTOCOL_TLSv1, ssl.CERT_NONE,
                              CERTFILE, CERTFILE, ssl.PROTOCOL_TLSv1,
@@ -710,7 +710,7 @@ else:
 
         def testReadCert(self):
 
-            if test_support.verbose:
+            if support.verbose:
                 sys.stdout.write("\n")
             s2 = socket.socket()
             server = ThreadedEchoServer(CERTFILE,
@@ -732,30 +732,30 @@ else:
                                         ssl_version=ssl.PROTOCOL_SSLv23)
                     s.connect((HOST, server.port))
                 except ssl.SSLError as x:
-                    raise test_support.TestFailed(
+                    raise support.TestFailed(
                         "Unexpected SSL error:  " + str(x))
                 except Exception as x:
-                    raise test_support.TestFailed(
+                    raise support.TestFailed(
                         "Unexpected exception:  " + str(x))
                 else:
                     if not s:
-                        raise test_support.TestFailed(
+                        raise support.TestFailed(
                             "Can't SSL-handshake with test server")
                     cert = s.getpeercert()
                     if not cert:
-                        raise test_support.TestFailed(
+                        raise support.TestFailed(
                             "Can't get peer certificate.")
                     cipher = s.cipher()
-                    if test_support.verbose:
+                    if support.verbose:
                         sys.stdout.write(pprint.pformat(cert) + '\n')
                         sys.stdout.write("Connection cipher is " + str(cipher) + '.\n')
                     if 'subject' not in cert:
-                        raise test_support.TestFailed(
+                        raise support.TestFailed(
                             "No subject field in certificate: %s." %
                             pprint.pformat(cert))
                     if ((('organizationName', 'Python Software Foundation'),)
                         not in cert['subject']):
-                        raise test_support.TestFailed(
+                        raise support.TestFailed(
                             "Missing or invalid 'organizationName' field in certificate subject; "
                             "should be 'Python Software Foundation'.")
                     s.close()
@@ -777,7 +777,7 @@ else:
 
             listener_ready = threading.Event()
             listener_gone = threading.Event()
-            port = test_support.find_unused_port()
+            port = support.find_unused_port()
 
             # `listener` runs in a thread.  It opens a socket listening on
             # PORT, and sits in an accept() until the main thread connects.
@@ -802,7 +802,7 @@ else:
                 except IOError:
                     pass
                 else:
-                    raise test_support.TestFailed(
+                    raise support.TestFailed(
                           'connecting to closed SSL socket should have failed')
 
             t = threading.Thread(target=listener)
@@ -811,7 +811,7 @@ else:
             t.join()
 
         def testProtocolSSL2(self):
-            if test_support.verbose:
+            if support.verbose:
                 sys.stdout.write("\n")
             tryProtocolCombo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True)
             tryProtocolCombo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True, ssl.CERT_OPTIONAL)
@@ -821,13 +821,13 @@ else:
             tryProtocolCombo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLSv1, False)
 
         def testProtocolSSL23(self):
-            if test_support.verbose:
+            if support.verbose:
                 sys.stdout.write("\n")
             try:
                 tryProtocolCombo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv2, True)
-            except test_support.TestFailed as x:
+            except support.TestFailed as x:
                 # this fails on some older versions of OpenSSL (0.9.7l, for instance)
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write(
                         " SSL2 client to SSL23 server test unexpectedly failed:\n %s\n"
                         % str(x))
@@ -844,7 +844,7 @@ else:
             tryProtocolCombo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True, ssl.CERT_REQUIRED)
 
         def testProtocolSSL3(self):
-            if test_support.verbose:
+            if support.verbose:
                 sys.stdout.write("\n")
             tryProtocolCombo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True)
             tryProtocolCombo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True, ssl.CERT_OPTIONAL)
@@ -854,7 +854,7 @@ else:
             tryProtocolCombo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLSv1, False)
 
         def testProtocolTLS1(self):
-            if test_support.verbose:
+            if support.verbose:
                 sys.stdout.write("\n")
             tryProtocolCombo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True)
             tryProtocolCombo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True, ssl.CERT_OPTIONAL)
@@ -884,13 +884,13 @@ else:
                     s.setblocking(1)
                     s.connect((HOST, server.port))
                 except Exception as x:
-                    raise test_support.TestFailed("Unexpected exception:  " + str(x))
+                    raise support.TestFailed("Unexpected exception:  " + str(x))
                 else:
-                    if test_support.verbose:
+                    if support.verbose:
                         sys.stdout.write("\n")
                     for indata in msgs:
                         msg = indata.encode('ASCII', 'replace')
-                        if test_support.verbose:
+                        if support.verbose:
                             sys.stdout.write(
                                 " client:  sending %s...\n" % repr(msg))
                         if wrapped:
@@ -901,7 +901,7 @@ else:
                             outdata = s.recv(1024)
                         if (indata == "STARTTLS" and
                             str(outdata, 'ASCII', 'replace').strip().lower().startswith("ok")):
-                            if test_support.verbose:
+                            if support.verbose:
                                 msg = str(outdata, 'ASCII', 'replace')
                                 sys.stdout.write(
                                     " client:  read %s from server, starting TLS...\n"
@@ -910,11 +910,11 @@ else:
 
                             wrapped = True
                         else:
-                            if test_support.verbose:
+                            if support.verbose:
                                 msg = str(outdata, 'ASCII', 'replace')
                                 sys.stdout.write(
                                     " client:  read %s from server\n" % repr(msg))
-                    if test_support.verbose:
+                    if support.verbose:
                         sys.stdout.write(" client:  closing connection.\n")
                     if wrapped:
                         conn.write("over\n".encode("ASCII", "strict"))
@@ -937,7 +937,7 @@ else:
             flag.wait()
             # try to connect
             try:
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write('\n')
                 d1 = open(CERTFILE, 'rb').read()
                 d2 = ''
@@ -948,33 +948,33 @@ else:
                 dlen = f.info().getheader("content-length")
                 if dlen and (int(dlen) > 0):
                     d2 = f.read(int(dlen))
-                    if test_support.verbose:
+                    if support.verbose:
                         sys.stdout.write(
                             " client: read %d bytes from remote server '%s'\n"
                             % (len(d2), server))
                 f.close()
             except:
                 msg = ''.join(traceback.format_exception(*sys.exc_info()))
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write('\n' + msg)
-                raise test_support.TestFailed(msg)
+                raise support.TestFailed(msg)
             else:
                 if not (d1 == d2):
                     print("d1 is", len(d1), repr(d1))
                     print("d2 is", len(d2), repr(d2))
-                    raise test_support.TestFailed(
+                    raise support.TestFailed(
                         "Couldn't fetch data from HTTPS server")
             finally:
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write('stopping server\n')
                 server.stop()
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write('joining thread\n')
                 server.join()
 
         def testAsyncoreServer(self):
 
-            if test_support.verbose:
+            if support.verbose:
                 sys.stdout.write("\n")
 
             indata="FOO\n"
@@ -988,25 +988,25 @@ else:
                 s = ssl.wrap_socket(socket.socket())
                 s.connect((HOST, server.port))
             except ssl.SSLError as x:
-                raise test_support.TestFailed("Unexpected SSL error:  " + str(x))
+                raise support.TestFailed("Unexpected SSL error:  " + str(x))
             except Exception as x:
-                raise test_support.TestFailed("Unexpected exception:  " + str(x))
+                raise support.TestFailed("Unexpected exception:  " + str(x))
             else:
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write(
                         " client:  sending %s...\n" % (repr(indata)))
                 s.sendall(indata.encode('ASCII', 'strict'))
                 outdata = s.recv()
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write(" client:  read %s\n" % repr(outdata))
                 outdata = str(outdata, 'ASCII', 'strict')
                 if outdata != indata.lower():
-                    raise test_support.TestFailed(
+                    raise support.TestFailed(
                         "bad data <<%s>> (%d) received; expected <<%s>> (%d)\n"
                         % (repr(outdata[:min(len(outdata),20)]), len(outdata),
                            repr(indata[:min(len(indata),20)].lower()), len(indata)))
                 s.write("over\n".encode("ASCII", "strict"))
-                if test_support.verbose:
+                if support.verbose:
                     sys.stdout.write(" client:  closing connection.\n")
                 s.close()
             finally:
@@ -1015,7 +1015,7 @@ else:
 
 def test_main(verbose=False):
     if skip_expected:
-        raise test_support.TestSkipped("No SSL support")
+        raise support.TestSkipped("No SSL support")
 
     global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT
     CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
@@ -1026,22 +1026,22 @@ def test_main(verbose=False):
 
     if (not os.path.exists(CERTFILE) or
         not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT)):
-        raise test_support.TestFailed("Can't read certificate files!")
+        raise support.TestFailed("Can't read certificate files!")
 
     tests = [BasicTests]
 
-    if test_support.is_resource_enabled('network'):
+    if support.is_resource_enabled('network'):
         tests.append(NetworkedTests)
 
     if _have_threads:
-        thread_info = test_support.threading_setup()
-        if thread_info and test_support.is_resource_enabled('network'):
+        thread_info = support.threading_setup()
+        if thread_info and support.is_resource_enabled('network'):
             tests.append(ThreadedTests)
 
-    test_support.run_unittest(*tests)
+    support.run_unittest(*tests)
 
     if _have_threads:
-        test_support.threading_cleanup(*thread_info)
+        support.threading_cleanup(*thread_info)
 
 if __name__ == "__main__":
     test_main()
index db099461023bbe24754739820e847607758db867..8d23dbb71e5ffd94fa3f891d4bdd7a9894202486 100644 (file)
@@ -8,7 +8,7 @@
 # call succeeded, but also the the script actually has run.
 
 import unittest
-from test import test_support
+from test import support
 
 # use this form so that the test is skipped when startfile is not available:
 from os import startfile, path
@@ -23,7 +23,7 @@ class TestCase(unittest.TestCase):
         startfile(empty, "open")
 
 def test_main():
-    test_support.run_unittest(TestCase)
+    support.run_unittest(TestCase)
 
 if __name__=="__main__":
     test_main()
index 5af5a0c2c3b61a9c47e45dd573630499c6f2ea2f..7128fd740832545b1d41b2643a4c1d1a6237df9a 100755 (executable)
@@ -6,7 +6,7 @@ import calendar
 import sys
 import os
 import re
-from test import test_support
+from test import support
 import time
 import unittest
 
@@ -68,7 +68,7 @@ class StrftimeTest(unittest.TestCase):
         self.strftest1(now)
         self.strftest2(now)
 
-        if test_support.verbose:
+        if support.verbose:
             print("Strftime test, platform: %s, Python version: %s" % \
                   (sys.platform, sys.version.split()[0]))
 
@@ -80,7 +80,7 @@ class StrftimeTest(unittest.TestCase):
                 self.strftest2(arg)
 
     def strftest1(self, now):
-        if test_support.verbose:
+        if support.verbose:
             print("strftime test for", time.ctime(now))
         now = self.now
         # Make sure any characters that could be taken as regex syntax is
@@ -162,24 +162,24 @@ class StrftimeTest(unittest.TestCase):
             except ValueError as result:
                 msg = "Error for nonstandard '%s' format (%s): %s" % \
                       (e[0], e[2], str(result))
-                if test_support.verbose:
+                if support.verbose:
                     print(msg)
                 continue
             if re.match(escapestr(e[1], self.ampm), result):
-                if test_support.verbose:
+                if support.verbose:
                     print("Supports nonstandard '%s' format (%s)" % (e[0], e[2]))
             elif not result or result[0] == '%':
-                if test_support.verbose:
+                if support.verbose:
                     print("Does not appear to support '%s' format (%s)" % \
                            (e[0], e[2]))
             else:
-                if test_support.verbose:
+                if support.verbose:
                     print("Conflict for nonstandard '%s' format (%s):" % \
                            (e[0], e[2]))
                     print("  Expected %s, but got %s" % (e[1], result))
 
 def test_main():
-    test_support.run_unittest(StrftimeTest)
+    support.run_unittest(StrftimeTest)
 
 if __name__ == '__main__':
     test_main()
index 4c3c964509f5579154ca1f073e72221f39f2c0ca..66f2204de4a89e6f3ab05c4ee1132794c5bb33c7 100644 (file)
@@ -1,5 +1,5 @@
 import unittest, string
-from test import test_support
+from test import support
 
 
 class ModuleTest(unittest.TestCase):
@@ -110,7 +110,7 @@ class ModuleTest(unittest.TestCase):
         self.assertRaises(TypeError, string.maketrans, 'abc', 'def')
 
 def test_main():
-    test_support.run_unittest(ModuleTest)
+    support.run_unittest(ModuleTest)
 
 if __name__ == "__main__":
     test_main()
index 04527902a81278d8c6d2d7d975b22a07af6dcde8..f3d3327ab0e23865201c09c2873e12d7fd3adb1d 100644 (file)
@@ -2,7 +2,7 @@
 # Since we don't have them, this test checks only a few codepoints.
 
 import unittest
-from test import test_support
+from test import support
 
 from stringprep import *
 
@@ -90,7 +90,7 @@ class StringprepTests(unittest.TestCase):
         #     print p, h.hexdigest()
 
 def test_main():
-    test_support.run_unittest(StringprepTests)
+    support.run_unittest(StringprepTests)
 
 if __name__ == '__main__':
     test_main()
index ac8905a299da146fc195ecf9963b1cebcf167b8a..436a487dff8fc85deda378f0f5b7d2c5eb0f4c5a 100644 (file)
@@ -5,7 +5,7 @@ import time
 import locale
 import re
 import sys
-from test import test_support
+from test import support
 from datetime import date as datetime_date
 
 import _strptime
@@ -551,7 +551,7 @@ class CacheTests(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         getlang_Tests,
         LocaleTime_Tests,
         TimeRETests,
index 61b5f6ce2622e54b5417a4a60e175ed63b9188f8..05ac760bac337e3d53095b195fed0c7c758fc577 100644 (file)
@@ -1,5 +1,5 @@
-from test.test_support import TestFailed, verbose, verify, vereq
-import test.test_support
+from test.support import TestFailed, verbose, verify, vereq
+import test.support
 import struct
 import array
 import warnings
@@ -50,7 +50,7 @@ def any_err(func, *args):
 
 def with_warning_restore(func):
     def _with_warning_restore(*args, **kw):
-        with test.test_support.catch_warning():
+        with test.support.catch_warning():
             # Grrr, we need this function to warn every time.  Without removing
             # the warningregistry, running test_tarfile then test_struct would fail
             # on 64-bit platforms.
index 97d7b23830fb2e8dc5c867a39ed1d49e64a37f9c..d6c9fea2175d3dafdc09d2f158642c1535b8128f 100644 (file)
@@ -6,7 +6,7 @@ from _testcapi import test_structmembersType, \
     LLONG_MAX, LLONG_MIN, ULLONG_MAX
 
 import warnings, unittest, sys
-from test import test_support
+from test import support
 
 ts=test_structmembersType(False, 1, 2, 3, 4, 5, 6, 7, 8,
                           9.99999, 10.1010101010)
@@ -69,39 +69,39 @@ class TestWarnings(unittest.TestCase):
         self.assertEqual(w.category, RuntimeWarning)
 
     def test_byte_max(self):
-        with test_support.catch_warning() as w:
+        with support.catch_warning() as w:
             ts.T_BYTE = CHAR_MAX+1
             self.has_warned(w)
 
     def test_byte_min(self):
-        with test_support.catch_warning() as w:
+        with support.catch_warning() as w:
             ts.T_BYTE = CHAR_MIN-1
             self.has_warned(w)
 
     def test_ubyte_max(self):
-        with test_support.catch_warning() as w:
+        with support.catch_warning() as w:
             ts.T_UBYTE = UCHAR_MAX+1
             self.has_warned(w)
 
     def test_short_max(self):
-        with test_support.catch_warning() as w:
+        with support.catch_warning() as w:
             ts.T_SHORT = SHRT_MAX+1
             self.has_warned(w)
 
     def test_short_min(self):
-        with test_support.catch_warning() as w:
+        with support.catch_warning() as w:
             ts.T_SHORT = SHRT_MIN-1
             self.has_warned(w)
 
     def test_ushort_max(self):
-        with test_support.catch_warning() as w:
+        with support.catch_warning() as w:
             ts.T_USHORT = USHRT_MAX+1
             self.has_warned(w)
 
 
 
 def test_main(verbose=None):
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main(verbose=True)
index 7ba142bca882ee3d070f864a3cb4a79f27dc31c8..124acff9f106bd63aab2a4a6fcc6c67ba9972f25 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 
 import time
 
@@ -114,7 +114,7 @@ class StructSeqTest(unittest.TestCase):
                                      L[start:stop:step])
 
 def test_main():
-    test_support.run_unittest(StructSeqTest)
+    support.run_unittest(StructSeqTest)
 
 if __name__ == "__main__":
     test_main()
index 3d6777f1e79d8a9d9faf50f26759aff3de48e0be..5a325ce130954cd30f126cd5845f5aaf58ee0e3d 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 import subprocess
 import sys
 import signal
@@ -31,14 +31,14 @@ class ProcessTestCase(unittest.TestCase):
     def setUp(self):
         # Try to minimize the number of children we have so this test
         # doesn't crash on some buildbots (Alphas in particular).
-        if hasattr(test_support, "reap_children"):
-            test_support.reap_children()
+        if hasattr(support, "reap_children"):
+            support.reap_children()
 
     def tearDown(self):
         # Try to minimize the number of children we have so this test
         # doesn't crash on some buildbots (Alphas in particular).
-        if hasattr(test_support, "reap_children"):
-            test_support.reap_children()
+        if hasattr(support, "reap_children"):
+            support.reap_children()
 
     def mkstemp(self):
         """wrapper for mkstemp, calling mktemp if mkstemp is not available"""
@@ -392,8 +392,8 @@ class ProcessTestCase(unittest.TestCase):
 
     def test_no_leaking(self):
         # Make sure we leak no resources
-        if (not hasattr(test_support, "is_resource_enabled") or
-            test_support.is_resource_enabled("subprocess") and not mswindows):
+        if (not hasattr(support, "is_resource_enabled") or
+            support.is_resource_enabled("subprocess") and not mswindows):
             max_handles = 1026 # too much for most UNIX systems
         else:
             max_handles = 65
@@ -703,9 +703,9 @@ class ProcessTestCase(unittest.TestCase):
             self.assertNotEqual(p.wait(), 0)
 
 def test_main():
-    test_support.run_unittest(ProcessTestCase)
-    if hasattr(test_support, "reap_children"):
-        test_support.reap_children()
+    support.run_unittest(ProcessTestCase)
+    if hasattr(support, "reap_children"):
+        support.reap_children()
 
 if __name__ == "__main__":
     unittest.main()  # XXX test_main()
index 1b6069dde08e86c70a118e330f29a5cfd4edc0cd..292722d5032aa456c5fe30002b077afebf0415fb 100644 (file)
@@ -1,13 +1,13 @@
 """Do a minimal test of all the modules that aren't otherwise tested."""
 
-from test import test_support
+from test import support
 import sys
 import unittest
 import warnings
 
 class TestUntestedModules(unittest.TestCase):
     def test_at_least_import_untested_modules(self):
-        with test_support.catch_warning():
+        with support.catch_warning():
             import CGIHTTPServer
             import aifc
             import bdb
@@ -73,14 +73,14 @@ class TestUntestedModules(unittest.TestCase):
             try:
                 import tty     # not available on Windows
             except ImportError:
-                if test_support.verbose:
+                if support.verbose:
                     print("skipping tty")
             import webbrowser
             import xml
 
 
 def test_main():
-    test_support.run_unittest(TestUntestedModules)
+    support.run_unittest(TestUntestedModules)
 
 if __name__ == "__main__":
     test_main()
index fc303eac73cf83a7b8054df3e004b3949fc6582a..5594b112a2f7252fd445c4fbfc512570069ac5df 100644 (file)
@@ -2,7 +2,7 @@
 
 import sys
 import unittest
-from test import test_support
+from test import support
 
 
 class A:
@@ -72,7 +72,7 @@ class TestSuper(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(TestSuper)
+    support.run_unittest(TestSuper)
 
 
 if __name__ == "__main__":
index 74a7c8559a66699db9f4137b975a564b4d53e6c6..77115e0c78b655c33f50810e6efa18a4eba6df3c 100644 (file)
@@ -1,4 +1,4 @@
-from test import test_support
+from test import support
 
 import symtable
 import unittest
@@ -38,7 +38,7 @@ class SymtableTest(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(SymtableTest)
+    support.run_unittest(SymtableTest)
 
 if __name__ == '__main__':
     test_main()
index 546f7a8626ca0d294625cbc201ba736d075fbf8f..11ca4ea88b77614743cd0dcb7377472c13015e35 100644 (file)
@@ -476,7 +476,7 @@ import re
 import unittest
 import warnings
 
-from test import test_support
+from test import support
 
 class SyntaxTestCase(unittest.TestCase):
 
@@ -548,9 +548,9 @@ class SyntaxTestCase(unittest.TestCase):
         self._check_error("int(base=10, '2')", "non-keyword arg")
 
 def test_main():
-    test_support.run_unittest(SyntaxTestCase)
+    support.run_unittest(SyntaxTestCase)
     from test import test_syntax
-    test_support.run_doctest(test_syntax, verbosity=True)
+    support.run_doctest(test_syntax, verbosity=True)
 
 if __name__ == "__main__":
     test_main()
index 3a0abe1586bc7ca3b18a0e1ee013f7e9354c2f14..7c66e0d768ac08e713524ae1ad1ff21e93d24d00 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: iso-8859-1 -*-
-import unittest, test.test_support
+import unittest, test.support
 import sys, io
 
 class SysModuleTest(unittest.TestCase):
@@ -350,7 +350,7 @@ class SysModuleTest(unittest.TestCase):
         #self.assert_(r[0][2] > 100, r[0][2])
 
 def test_main():
-    test.test_support.run_unittest(SysModuleTest)
+    test.support.run_unittest(SysModuleTest)
 
 if __name__ == "__main__":
     test_main()
index 3f22c0da38078a572dc2bbe1186877a607d6cbe6..3a3d63555f3de6f01fdf060b8244a2f26e2c7f3f 100644 (file)
@@ -1,7 +1,7 @@
 
 import syslog
 import unittest
-from test import test_support
+from test import support
 
 # XXX(nnorwitz): This test sucks.  I don't know of a platform independent way
 # to verify that the messages were really logged.
@@ -31,7 +31,7 @@ class Test(unittest.TestCase):
         syslog.LOG_UPTO(syslog.LOG_INFO)
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index 2fbb51e6add3ab3fe0611fcfa5a1a3bca7d6e04d..9fde707a8f176f0e79aa18bdf65fb0f8bd09db80 100644 (file)
@@ -10,7 +10,7 @@ import errno
 import unittest
 import tarfile
 
-from test import test_support
+from test import support
 
 # Check for our compression modules.
 try:
@@ -27,7 +27,7 @@ def md5sum(data):
     return md5(data).hexdigest()
 
 def path(path):
-    return test_support.findfile(path)
+    return support.findfile(path)
 
 TEMPDIR = os.path.join(tempfile.gettempdir(), "test_tarfile_tmp")
 tarname = path("testtar.tar")
@@ -1171,7 +1171,7 @@ def test_main():
         ]
 
     try:
-        test_support.run_unittest(*tests)
+        support.run_unittest(*tests)
     finally:
         if os.path.exists(TEMPDIR):
             shutil.rmtree(TEMPDIR)
index 4255d8afa3b1c252d668fccab85a17ae9c35fd51..9a327dc1851909a917016c7870ac8dad4b0e7825 100644 (file)
@@ -2,7 +2,7 @@
 
 import unittest
 import os
-from test import test_support
+from test import support
 from Tkinter import Tcl
 from _tkinter import TclError
 
@@ -151,7 +151,7 @@ class TclTest(unittest.TestCase):
                 os.environ['DISPLAY'] = old_display
 
 def test_main():
-    test_support.run_unittest(TclTest)
+    support.run_unittest(TclTest)
 
 if __name__ == "__main__":
     test_main()
index e4ee1b5da762f571ebf96cb2713047aad3ca8b18..c24d41d02d794d9114c5746ea6f7371c8689b01c 100644 (file)
@@ -4,9 +4,9 @@ import telnetlib
 import time
 
 from unittest import TestCase
-from test import test_support
+from test import support
 
-HOST = test_support.HOST
+HOST = support.HOST
 
 def server(evt, serv):
     serv.listen(5)
@@ -25,7 +25,7 @@ class GeneralTests(TestCase):
         self.evt = threading.Event()
         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         self.sock.settimeout(3)
-        self.port = test_support.bind_port(self.sock)
+        self.port = support.bind_port(self.sock)
         threading.Thread(target=server, args=(self.evt,self.sock)).start()
         self.evt.wait()
         self.evt.clear()
@@ -71,7 +71,7 @@ class GeneralTests(TestCase):
 
 
 def test_main(verbose=None):
-    test_support.run_unittest(GeneralTests)
+    support.run_unittest(GeneralTests)
 
 if __name__ == '__main__':
     test_main()
index e88efebbd82dae2999799ccf98575887ebf8c2b9..5a81455213e4ff60e99523ba3aea89f812b13e1c 100644 (file)
@@ -7,7 +7,7 @@ import errno
 import warnings
 
 import unittest
-from test import test_support
+from test import support
 
 warnings.filterwarnings("ignore",
                         category=RuntimeWarning,
@@ -116,7 +116,7 @@ class test__RandomNameSequence(TC):
             self.failIf(s in dict)
             dict[s] = 1
 
-    def test_supports_iter(self):
+    def supports_iter(self):
         # _RandomNameSequence supports the iterator protocol
 
         i = 0
@@ -276,7 +276,7 @@ class test__mkstemp_inner(TC):
         if not has_spawnl:
             return            # ugh, can't use TestSkipped.
 
-        if test_support.verbose:
+        if support.verbose:
             v="v"
         else:
             v="q"
@@ -881,7 +881,7 @@ if tempfile.NamedTemporaryFile is not tempfile.TemporaryFile:
     test_classes.append(test_TemporaryFile)
 
 def test_main():
-    test_support.run_unittest(*test_classes)
+    support.run_unittest(*test_classes)
 
 if __name__ == "__main__":
     test_main()
index 1a9761a954bb15b862cee905c0fdb321ee19f82b..1cbd9cece0e1891957eddebe3ce3b63ac3f6deaa 100644 (file)
@@ -9,7 +9,7 @@
 #
 
 import unittest
-from test import test_support
+from test import support
 
 from textwrap import TextWrapper, wrap, fill, dedent
 
@@ -579,7 +579,7 @@ def foo():
 
 
 def test_main():
-    test_support.run_unittest(WrapTestCase,
+    support.run_unittest(WrapTestCase,
                               LongWordTestCase,
                               IndentTestCases,
                               DedentTestCase)
index 01d66552957b4976940cc83d857e3378e643c37f..cff9f81ff5eafa3ed870dcafb186210c2848eb99 100644 (file)
@@ -1,7 +1,7 @@
 import os
 import unittest
 import random
-from test import test_support
+from test import support
 import thread
 import time
 
@@ -13,7 +13,7 @@ _print_mutex = thread.allocate_lock()
 
 def verbose_print(arg):
     """Helper function for printing out debugging output."""
-    if test_support.verbose:
+    if support.verbose:
         with _print_mutex:
             print(arg)
 
@@ -159,7 +159,7 @@ class BarrierTest(BasicThreadTest):
             self.done_mutex.release()
 
 def test_main():
-    test_support.run_unittest(ThreadRunningTests, BarrierTest)
+    support.run_unittest(ThreadRunningTests, BarrierTest)
 
 if __name__ == "__main__":
     test_main()
index 41a2b9099fef042aaecfa63215a0e8c2c1d542a5..fbe479cd308e108ccb923b81eb7087803024a6a4 100644 (file)
@@ -6,7 +6,7 @@
 # randrange, and then Python hangs.
 
 import thread
-from test.test_support import verbose, TestSkipped, TestFailed
+from test.support import verbose, TestSkipped, TestFailed
 
 critical_section = thread.allocate_lock()
 done = thread.allocate_lock()
index cde15b42e29ed6e443468fb189437e08e79418c2..fb122d0d87d8afc5ab5839319559810724567928 100644 (file)
@@ -20,7 +20,7 @@ import thread # If this fails, we can't test this module
 import threading
 import tempfile
 
-from test.test_support import threading_setup, threading_cleanup, run_unittest
+from test.support import threading_setup, threading_cleanup, run_unittest
 import unittest
 import io
 from traceback import print_exc
index 1017f5659825714be28b0287d950cd6706574303..9582dde1e4c0d33e474ab5579e6425198e13c2ea 100644 (file)
@@ -1,7 +1,7 @@
 # Very rudimentary test of threading module
 
-import test.test_support
-from test.test_support import verbose
+import test.support
+from test.support import verbose
 import random
 import sys
 import threading
@@ -356,7 +356,7 @@ class ThreadingExceptionTests(unittest.TestCase):
 
 
 def test_main():
-    test.test_support.run_unittest(ThreadTests,
+    test.support.run_unittest(ThreadTests,
                                    ThreadingExceptionTests)
 
 if __name__ == "__main__":
index b7dd538f8ec109571e716eaf4eae9d0e576d71a4..e48dc5973bd73013a15ac84476878610ea5ae557 100644 (file)
@@ -1,6 +1,6 @@
 import unittest
 from doctest import DocTestSuite
-from test import test_support
+from test import support
 import threading
 import weakref
 import gc
@@ -62,7 +62,7 @@ def test_main():
                                    setUp=setUp, tearDown=tearDown)
                       )
 
-    test_support.run_unittest(suite)
+    support.run_unittest(suite)
 
 if __name__ == '__main__':
     test_main()
index 2f014e146ba2c5d7fe424d3e2ac88394d5af9a4d..cbed42c002e51871d9eb0ae1c77dabbf2f66bd74 100644 (file)
@@ -5,7 +5,7 @@ import thread
 import signal
 import os
 import sys
-from test.test_support import run_unittest, TestSkipped
+from test.support import run_unittest, TestSkipped
 
 if sys.platform[:3] in ('win', 'os2'):
     raise TestSkipped("Can't test signal on %s" % sys.platform)
index 3a7fa0f4bc972bddc9920b1db165ad3569c5c80d..4c89f03bab31f8bf222648b90898cd415bb6d2e6 100644 (file)
@@ -1,4 +1,4 @@
-from test import test_support
+from test import support
 import time
 import unittest
 
@@ -219,7 +219,7 @@ class TimeTestCase(unittest.TestCase):
         self.assert_(0 <= (t1-t0) < 0.2)
 
 def test_main():
-    test_support.run_unittest(TimeTestCase)
+    support.run_unittest(TimeTestCase)
 
 
 if __name__ == "__main__":
index 6324fc1831f9b61411b41e102fe8b42f8eb363af..264704e7e2755553b5be652da07352a39c8b6501 100644 (file)
@@ -1,10 +1,10 @@
 """Unit tests for socket timeout feature."""
 
 import unittest
-from test import test_support
+from test import support
 
 # This requires the 'network' resource as given on the regrtest command line.
-skip_expected = not test_support.is_resource_enabled('network')
+skip_expected = not support.is_resource_enabled('network')
 
 import time
 import socket
@@ -191,8 +191,8 @@ class TimeoutTestCase(unittest.TestCase):
 
 
 def test_main():
-    test_support.requires('network')
-    test_support.run_unittest(CreationTestCase, TimeoutTestCase)
+    support.requires('network')
+    support.run_unittest(CreationTestCase, TimeoutTestCase)
 
 if __name__ == "__main__":
     test_main()
index ea9030b7c7ccbd3e2d9d2b536f1f0600386680bd..8fbd216ac66fde8f46565d0f932a005548823d18 100644 (file)
@@ -60,7 +60,7 @@ two trailing blanks apparent in the expected output.
     ...           "  print(x)\\n")
     True
 
-    >>> f = test_support.findfile("tokenize_tests.txt")
+    >>> f = support.findfile("tokenize_tests.txt")
     >>> roundtrip(open(f, 'rb'))
     True
 
@@ -522,7 +522,7 @@ pass the '-ucompiler' option to process the full directory.
     >>> tempdir = os.path.dirname(f) or os.curdir
     >>> testfiles = glob.glob(os.path.join(tempdir, "test*.py"))
 
-    >>> if not test_support.is_resource_enabled("compiler"):
+    >>> if not support.is_resource_enabled("compiler"):
     ...     testfiles = random.sample(testfiles, 10)
     ...
     >>> for testfile in testfiles:
@@ -533,7 +533,7 @@ pass the '-ucompiler' option to process the full directory.
     True
 """
 
-from test import test_support
+from test import support
 from tokenize import (tokenize, _tokenize, untokenize, NUMBER, NAME, OP,
                      STRING, ENDMARKER, tok_name, detect_encoding)
 from io import BytesIO
@@ -842,11 +842,11 @@ __test__ = {"doctests" : doctests, 'decistmt': decistmt}
 
 def test_main():
     from test import test_tokenize
-    test_support.run_doctest(test_tokenize, True)
-    test_support.run_unittest(TestTokenizerAdheresToPep0263)
-    test_support.run_unittest(Test_Tokenize)
-    test_support.run_unittest(TestDetectEncoding)
-    test_support.run_unittest(TestTokenize)
+    support.run_doctest(test_tokenize, True)
+    support.run_unittest(TestTokenizerAdheresToPep0263)
+    support.run_unittest(Test_Tokenize)
+    support.run_unittest(TestDetectEncoding)
+    support.run_unittest(TestTokenize)
 
 if __name__ == "__main__":
     test_main()
index 9ecd995841b4240feb5bed71b84c6542bad2b274..48a717ba8f5d64d6bd07ce227d26ca86c27b07f8 100644 (file)
@@ -1,6 +1,6 @@
 # Testing the line trace facility.
 
-from test import test_support
+from test import support
 import unittest
 import sys
 import difflib
@@ -742,7 +742,7 @@ class JumpTestCase(unittest.TestCase):
         no_jump_without_trace_function()
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         TraceTestCase,
         RaisingTraceFuncTestCase,
         JumpTestCase
index 600c7b5eef313ca7d2ff695178572170f1b73929..3f89e6a795bb3c77c77a32901552a97f5d0a67ed 100644 (file)
@@ -4,7 +4,7 @@ from _testcapi import traceback_print
 from io import StringIO
 import sys
 import unittest
-from test.test_support import run_unittest, is_jython, Error
+from test.support import run_unittest, is_jython, Error
 
 import traceback
 
index 77672e71237463a8d39d71dfc2361d23639d5fa8..de081314db01ec71a943095cf2da72d765c5aab5 100644 (file)
@@ -1,4 +1,4 @@
-from test import test_support, seq_tests
+from test import support, seq_tests
 
 class TupleTest(seq_tests.CommonTest):
     type2test = tuple
@@ -83,7 +83,7 @@ class TupleTest(seq_tests.CommonTest):
         self.assertEqual(repr(a2), "(0, 1, 2)")
 
 def test_main():
-    test_support.run_unittest(TupleTest)
+    support.run_unittest(TupleTest)
 
 if __name__=="__main__":
     test_main()
index 1dcc82c18690b96077bea1a90bffbf8f8f84a545..901c32655d14cce4a56f8fd42d71713082c6b555 100644 (file)
@@ -1,7 +1,7 @@
 """Unit tests for __instancecheck__ and __subclasscheck__."""
 
 import unittest
-from test import test_support
+from test import support
 
 
 class ABC(type):
@@ -56,7 +56,7 @@ class TypeChecksTest(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(TypeChecksTest)
+    support.run_unittest(TypeChecksTest)
 
 
 if __name__ == "__main__":
index 2fc0004790e05ee3a9fc9f6d99b2ebe8fa966f0d..948e8d4bae14db539a6d36b60731c3a2ff445a3c 100644 (file)
@@ -1,6 +1,6 @@
 # Python test set -- part 6, built-in types
 
-from test.test_support import run_unittest, run_with_locale
+from test.support import run_unittest, run_with_locale
 import unittest
 import sys
 import locale
index 78cb78042e816a2e72e4382ecffdcb347f92e3b5..2d48179c599ae2a9109560e751e92aa35aeb797e 100644 (file)
@@ -9,7 +9,7 @@ Modified for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com)
 
 import unittest
 
-from test import test_support
+from test import support
 
 class UnicodeNamesTest(unittest.TestCase):
 
@@ -138,7 +138,7 @@ class UnicodeNamesTest(unittest.TestCase):
         )
 
 def test_main():
-    test_support.run_unittest(UnicodeNamesTest)
+    support.run_unittest(UnicodeNamesTest)
 
 if __name__ == "__main__":
     test_main()
index dbefe623107b826140d40de64d4fd95a303cff55..7dd651e8db28e123a45b5a5b9303a66738cca8c7 100644 (file)
@@ -1,7 +1,7 @@
 """Test compiler changes for unary ops (+, -, ~) introduced in Python 2.2"""
 
 import unittest
-from test.test_support import run_unittest
+from test.support import run_unittest
 
 class UnaryOpTestCase(unittest.TestCase):
 
index c64dee554499e1a6bcb575ca964414ed3812f5c5..2f9add5ec38233463f01ea7d6bc48e11fd876d40 100644 (file)
@@ -11,7 +11,7 @@ import struct
 import sys
 import unittest
 import warnings
-from test import test_support, string_tests
+from test import support, string_tests
 
 # Error handling (bad decoder return)
 def search_function(encoding):
@@ -671,7 +671,7 @@ class UnicodeTest(
                 return '\u1234'
         self.assertEqual('%s' % Wrapper(), '\u1234')
 
-    @test_support.run_with_locale('LC_ALL', 'de_DE', 'fr_FR')
+    @support.run_with_locale('LC_ALL', 'de_DE', 'fr_FR')
     def test_format_float(self):
         # should not format with a comma, but always with C locale
         self.assertEqual('1.0', '%.1f' % 1.0)
@@ -1077,7 +1077,7 @@ class UnicodeTest(
 
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index 5f0681e4797444f787da6d4f592befc37b073c22..cc670db92210a7a598ffc6880d64c2e54fdf0a47 100644 (file)
@@ -5,8 +5,8 @@ import os, glob, time, shutil
 import unicodedata
 
 import unittest
-from test.test_support import run_unittest, TestSkipped, TESTFN_UNICODE
-from test.test_support import TESTFN_ENCODING, TESTFN_UNICODE_UNENCODEABLE
+from test.support import run_unittest, TestSkipped, TESTFN_UNICODE
+from test.support import TESTFN_ENCODING, TESTFN_UNICODE_UNENCODEABLE
 try:
     TESTFN_UNICODE.encode(TESTFN_ENCODING)
 except (UnicodeError, TypeError):
index c4ea816b6d06c2e239eee23f4fd54fd89a63ee8f..08208f960c4cc8260e1e5d17197e2a89515e5acc 100644 (file)
@@ -5,7 +5,7 @@
     (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
 
 """#"
-import unittest, test.test_support
+import unittest, test.support
 import hashlib
 
 encoding = 'utf-8'
@@ -219,7 +219,7 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
         self.assertEquals(self.db.lookup("GOTHIC LETTER FAIHU"), '\U00010346')
 
 def test_main():
-    test.test_support.run_unittest(
+    test.support.run_unittest(
         UnicodeMiscTest,
         UnicodeMethodsTest,
         UnicodeFunctionsTest
index ed27618eea81f1d4d321c29a9fc956a608a7cf94..c9c17d3dff9473fe1cc8c5b28e3562c8c049658c 100644 (file)
@@ -6,7 +6,7 @@ Still need testing:
     TestCase.{assert,fail}* methods (some are tested implicitly)
 """
 
-from test import test_support
+from test import support
 import unittest
 from unittest import TestCase
 import types
@@ -2289,7 +2289,7 @@ class Test_Assertions(TestCase):
 ######################################################################
 
 def test_main():
-    test_support.run_unittest(Test_TestCase, Test_TestLoader,
+    support.run_unittest(Test_TestCase, Test_TestLoader,
         Test_TestSuite, Test_TestResult, Test_FunctionTestCase,
         Test_Assertions)
 
index c3b7bc44ca800878642c69b1d0a80c70f609bd2b..c4e4a3fbbb710a0cc487b5c32b0f429987027d95 100644 (file)
@@ -2,10 +2,10 @@
 import unittest
 import os
 import sys
-from test import test_support
+from test import support
 
 if not hasattr(sys.stdin, 'newlines'):
-    raise test_support.TestSkipped(
+    raise support.TestSkipped(
                        "This Python does not have universal newline support")
 
 FATX = 'x' * (2**14)
@@ -35,7 +35,7 @@ class TestGenericUnivNewlines(unittest.TestCase):
     WRITEMODE = 'wb'
 
     def setUp(self):
-        fp = open(test_support.TESTFN, self.WRITEMODE)
+        fp = open(support.TESTFN, self.WRITEMODE)
         data = self.DATA
         if "b" in self.WRITEMODE:
             data = data.encode("ascii")
@@ -44,24 +44,24 @@ class TestGenericUnivNewlines(unittest.TestCase):
 
     def tearDown(self):
         try:
-            os.unlink(test_support.TESTFN)
+            os.unlink(support.TESTFN)
         except:
             pass
 
     def test_read(self):
-        fp = open(test_support.TESTFN, self.READMODE)
+        fp = open(support.TESTFN, self.READMODE)
         data = fp.read()
         self.assertEqual(data, DATA_LF)
         self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
 
     def test_readlines(self):
-        fp = open(test_support.TESTFN, self.READMODE)
+        fp = open(support.TESTFN, self.READMODE)
         data = fp.readlines()
         self.assertEqual(data, DATA_SPLIT)
         self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
 
     def test_readline(self):
-        fp = open(test_support.TESTFN, self.READMODE)
+        fp = open(support.TESTFN, self.READMODE)
         data = []
         d = fp.readline()
         while d:
@@ -71,7 +71,7 @@ class TestGenericUnivNewlines(unittest.TestCase):
         self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
 
     def test_seek(self):
-        fp = open(test_support.TESTFN, self.READMODE)
+        fp = open(support.TESTFN, self.READMODE)
         fp.readline()
         pos = fp.tell()
         data = fp.readlines()
@@ -94,7 +94,7 @@ class TestCRLFNewlines(TestGenericUnivNewlines):
     DATA = DATA_CRLF
 
     def test_tell(self):
-        fp = open(test_support.TESTFN, self.READMODE)
+        fp = open(support.TESTFN, self.READMODE)
         self.assertEqual(repr(fp.newlines), repr(None))
         data = fp.readline()
         pos = fp.tell()
@@ -106,7 +106,7 @@ class TestMixedNewlines(TestGenericUnivNewlines):
 
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         TestCRNewlines,
         TestLFNewlines,
         TestCRLFNewlines,
index a90b5e5c18e631c793bf5f11b5a3d8a199b13bdd..b1531f306d8220663a89a3540e39dc5dfb714a5e 100644 (file)
@@ -122,9 +122,9 @@ error)
 __test__ = {'doctests' : doctests}
 
 def test_main(verbose=False):
-    from test import test_support
+    from test import support
     from test import test_unpack
-    test_support.run_doctest(test_unpack, verbose)
+    support.run_doctest(test_unpack, verbose)
 
 if __name__ == "__main__":
     test_main(verbose=True)
index 89486b8d2d419f0f8f351a0835293a3fd6e39483..ae2dcbd985ed5a93f672ac58023ae6e694da7365 100644 (file)
@@ -166,9 +166,9 @@ __test__ = {'doctests' : doctests}
 
 def test_main(verbose=False):
     import sys
-    from test import test_support
+    from test import support
     from test import test_unpack_ex
-    test_support.run_doctest(test_unpack_ex, verbose)
+    support.run_doctest(test_unpack_ex, verbose)
 
 if __name__ == "__main__":
     test_main(verbose=True)
index d58414cf25397a1c79a4d35086305c3c16cd2c59..7db281cb90f8ed56575c4eda09bda398628a02f3 100644 (file)
@@ -4,7 +4,7 @@ import urllib
 import httplib
 import io
 import unittest
-from test import test_support
+from test import support
 import os
 import mimetools
 import tempfile
@@ -27,18 +27,18 @@ class urlopen_FileTests(unittest.TestCase):
     def setUp(self):
         """Setup of a temp file to use for testing"""
         self.text = bytes("test_urllib: %s\n" % self.__class__.__name__, "ascii")
-        FILE = open(test_support.TESTFN, 'wb')
+        FILE = open(support.TESTFN, 'wb')
         try:
             FILE.write(self.text)
         finally:
             FILE.close()
-        self.pathname = test_support.TESTFN
+        self.pathname = support.TESTFN
         self.returned_obj = urllib.urlopen("file:%s" % self.pathname)
 
     def tearDown(self):
         """Shut down the open object"""
         self.returned_obj.close()
-        os.remove(test_support.TESTFN)
+        os.remove(support.TESTFN)
 
     def test_interface(self):
         # Make sure object returned by urlopen() has the specified methods
@@ -163,10 +163,10 @@ class urlretrieve_FileTests(unittest.TestCase):
         self.tempFiles = []
 
         # Create a temporary file.
-        self.registerFileForCleanUp(test_support.TESTFN)
+        self.registerFileForCleanUp(support.TESTFN)
         self.text = b'testing urllib.urlretrieve'
         try:
-            FILE = open(test_support.TESTFN, 'wb')
+            FILE = open(support.TESTFN, 'wb')
             FILE.write(self.text)
             FILE.close()
         finally:
@@ -204,18 +204,18 @@ class urlretrieve_FileTests(unittest.TestCase):
     def test_basic(self):
         # Make sure that a local file just gets its own location returned and
         # a headers value is returned.
-        result = urllib.urlretrieve("file:%s" % test_support.TESTFN)
-        self.assertEqual(result[0], test_support.TESTFN)
+        result = urllib.urlretrieve("file:%s" % support.TESTFN)
+        self.assertEqual(result[0], support.TESTFN)
         self.assert_(isinstance(result[1], mimetools.Message),
                      "did not get a mimetools.Message instance as second "
                      "returned value")
 
     def test_copy(self):
         # Test that setting the filename argument works.
-        second_temp = "%s.2" % test_support.TESTFN
+        second_temp = "%s.2" % support.TESTFN
         self.registerFileForCleanUp(second_temp)
         result = urllib.urlretrieve(self.constructLocalFileUrl(
-            test_support.TESTFN), second_temp)
+            support.TESTFN), second_temp)
         self.assertEqual(second_temp, result[0])
         self.assert_(os.path.exists(second_temp), "copy of the file was not "
                                                   "made")
@@ -236,9 +236,9 @@ class urlretrieve_FileTests(unittest.TestCase):
             self.assert_(isinstance(total_size, int))
             self.assertEqual(count, count_holder[0])
             count_holder[0] = count_holder[0] + 1
-        second_temp = "%s.2" % test_support.TESTFN
+        second_temp = "%s.2" % support.TESTFN
         self.registerFileForCleanUp(second_temp)
-        urllib.urlretrieve(self.constructLocalFileUrl(test_support.TESTFN),
+        urllib.urlretrieve(self.constructLocalFileUrl(support.TESTFN),
             second_temp, hooktester)
 
     def test_reporthook_0_bytes(self):
@@ -248,7 +248,7 @@ class urlretrieve_FileTests(unittest.TestCase):
             _report.append((count, block_size, total_size))
         srcFileName = self.createNewTempFile()
         urllib.urlretrieve(self.constructLocalFileUrl(srcFileName),
-            test_support.TESTFN, hooktester)
+            support.TESTFN, hooktester)
         self.assertEqual(len(report), 1)
         self.assertEqual(report[0][2], 0)
 
@@ -262,7 +262,7 @@ class urlretrieve_FileTests(unittest.TestCase):
             _report.append((count, block_size, total_size))
         srcFileName = self.createNewTempFile(b"x" * 5)
         urllib.urlretrieve(self.constructLocalFileUrl(srcFileName),
-            test_support.TESTFN, hooktester)
+            support.TESTFN, hooktester)
         self.assertEqual(len(report), 2)
         self.assertEqual(report[0][1], 8192)
         self.assertEqual(report[0][2], 5)
@@ -276,7 +276,7 @@ class urlretrieve_FileTests(unittest.TestCase):
             _report.append((count, block_size, total_size))
         srcFileName = self.createNewTempFile(b"x" * 8193)
         urllib.urlretrieve(self.constructLocalFileUrl(srcFileName),
-            test_support.TESTFN, hooktester)
+            support.TESTFN, hooktester)
         self.assertEqual(len(report), 3)
         self.assertEqual(report[0][1], 8192)
         self.assertEqual(report[0][2], 8193)
@@ -632,7 +632,7 @@ class Pathname_Tests(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         urlopen_FileTests,
         urlopen_HttpTests,
         urlretrieve_FileTests,
index d34a17746ee97d793e00c4ed4619c2490b92749b..cb730e2057492e44cbccc7ea58bc5c7f74f9de80 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 
 import os
 import io
@@ -588,7 +588,7 @@ class HandlerTests(unittest.TestCase):
         h = urllib2.FileHandler()
         o = h.parent = MockOpener()
 
-        TESTFN = test_support.TESTFN
+        TESTFN = support.TESTFN
         urlpath = sanepathname2url(os.path.abspath(TESTFN))
         towrite = b"hello, world\n"
         urls = [
@@ -1075,13 +1075,13 @@ class MiscTests(unittest.TestCase):
 
 def test_main(verbose=None):
     from test import test_urllib2
-    test_support.run_doctest(test_urllib2, verbose)
-    test_support.run_doctest(urllib2, verbose)
+    support.run_doctest(test_urllib2, verbose)
+    support.run_doctest(urllib2, verbose)
     tests = (TrivialTests,
              OpenerDirectorTests,
              HandlerTests,
              MiscTests)
-    test_support.run_unittest(*tests)
+    support.run_unittest(*tests)
 
 if __name__ == "__main__":
     test_main(verbose=True)
index 0815658602fdd2d7093a4fe6ae5405851ee600ce..6bf1820f22cd5eefd0ac290a9e7f1e4ae7f4fc78 100644 (file)
@@ -7,7 +7,7 @@ import urllib2
 import BaseHTTPServer
 import unittest
 import hashlib
-from test import test_support
+from test import support
 
 # Loopback http server infrastructure
 
@@ -481,10 +481,10 @@ def test_main():
     # (Lib/test/regrtest.py -u network) since all tests here are only
     # localhost.  However, if this is a bad rationale, then uncomment
     # the next line.
-    #test_support.requires("network")
+    #support.requires("network")
 
-    test_support.run_unittest(ProxyAuthTests)
-    test_support.run_unittest(TestUrlopen)
+    support.run_unittest(ProxyAuthTests)
+    support.run_unittest(TestUrlopen)
 
 if __name__ == "__main__":
     test_main()
index 75df9fd7b932b2af5c616c40c0f05989506bff83..89e48cb9d506b57c6daf35dfc11c65205e22d42f 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 import unittest
-from test import test_support
+from test import support
 from test.test_urllib2 import sanepathname2url
 
 import socket
@@ -105,7 +105,7 @@ class OtherNetworkTests(unittest.TestCase):
         self._test_urls(urls, self._extra_handlers())
 
     def test_file(self):
-        TESTFN = test_support.TESTFN
+        TESTFN = support.TESTFN
         f = open(TESTFN, 'w')
         try:
             f.write('hi there\n')
@@ -169,7 +169,7 @@ class OtherNetworkTests(unittest.TestCase):
                            (expected_err, url, req, type(err), err))
                     self.assert_(isinstance(err, expected_err), msg)
             else:
-                with test_support.transient_internet():
+                with support.transient_internet():
                     buf = f.read()
                 f.close()
                 debug("read %d bytes" % len(buf))
@@ -233,8 +233,8 @@ class TimeoutTest(unittest.TestCase):
 
 
 def test_main():
-    test_support.requires("network")
-    test_support.run_unittest(AuthTests,
+    support.requires("network")
+    support.run_unittest(AuthTests,
                               OtherNetworkTests,
                               CloseSocketTest,
                               TimeoutTest,
index 6fd468424126181772835f3bffad3b4ee0bde524..6c2632c55a0fb7f176c8346952ab45214669c2c9 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 import unittest
-from test import test_support
+from test import support
 
 import socket
 import urllib
@@ -166,8 +166,8 @@ class urlretrieveNetworkTests(unittest.TestCase):
     def test_specified_path(self):
         # Make sure that specifying the location of the file to write to works.
         file_location,info = self.urlretrieve("http://www.python.org/",
-                                              test_support.TESTFN)
-        self.assertEqual(file_location, test_support.TESTFN)
+                                              support.TESTFN)
+        self.assertEqual(file_location, support.TESTFN)
         self.assert_(os.path.exists(file_location))
         FILE = open(file_location, errors='ignore')
         try:
@@ -186,8 +186,8 @@ class urlretrieveNetworkTests(unittest.TestCase):
 
 
 def test_main():
-    test_support.requires('network')
-    test_support.run_unittest(URLTimeoutTest,
+    support.requires('network')
+    support.run_unittest(URLTimeoutTest,
                               urlopenNetworkTests,
                               urlretrieveNetworkTests)
 
index 8ab8f35c2111be7d435ae1305617436b49fa1ccf..02b2f6f109929bcdce146cadba4a745d7ef984c7 100644 (file)
@@ -1,6 +1,6 @@
 #! /usr/bin/env python
 
-from test import test_support
+from test import support
 import unittest
 import urlparse
 
@@ -311,7 +311,7 @@ class UrlParseTestCase(unittest.TestCase):
                          ('http', 'example.com', '', '', 'blahblah=/foo', ''))
 
 def test_main():
-    test_support.run_unittest(UrlParseTestCase)
+    support.run_unittest(UrlParseTestCase)
 
 if __name__ == "__main__":
     test_main()
index 3a8a8b4925db724d66031aa458893219986890bf..30eec71935f47390ccdccb1db2bef52972fcfb0b 100644 (file)
@@ -1,6 +1,6 @@
 # Check every path through every method of UserDict
 
-from test import test_support, mapping_tests
+from test import support, mapping_tests
 import collections
 
 d0 = {}
@@ -190,7 +190,7 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol):
 
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         UserDictTest,
     )
 
index a0daa4e8ede3ad81587d309ee71016a41d6e803c..868ed24cccda59bd014b64e3aedd5fe71da7c5d9 100644 (file)
@@ -1,7 +1,7 @@
 # Check every path through every method of UserList
 
 from collections import UserList
-from test import test_support, list_tests
+from test import support, list_tests
 
 class UserListTest(list_tests.CommonTest):
     type2test = UserList
@@ -53,7 +53,7 @@ class UserListTest(list_tests.CommonTest):
         self.assertEqual(next(iter(T((1,2)))), "0!!!")
 
 def test_main():
-    test_support.run_unittest(UserListTest)
+    support.run_unittest(UserListTest)
 
 if __name__ == "__main__":
     test_main()
index e8fb13507ba8a027678dbdef1f5185e4ecb76297..05381384bf6a7b581cf66ced76575da22e9212e6 100755 (executable)
@@ -3,7 +3,7 @@
 # UserString instances should behave similar to builtin string objects.
 
 import string
-from test import test_support, string_tests
+from test import support, string_tests
 
 from collections import UserString
 
@@ -43,7 +43,7 @@ class UserStringTest(
 
 
 def test_main():
-    test_support.run_unittest(UserStringTest)
+    support.run_unittest(UserStringTest)
 
 if __name__ == "__main__":
     test_main()
index b4bb32be007b857d37380b5906474f8f16ff1fcb..02d0171c374e285ab1197cc47ca8488f72a65580 100644 (file)
@@ -4,7 +4,7 @@ Nick Mathewson
 """
 
 import unittest
-from test import test_support
+from test import support
 
 import sys, os
 import uu
@@ -111,8 +111,8 @@ class UUFileTest(unittest.TestCase):
             pass
 
     def setUp(self):
-        self.tmpin  = test_support.TESTFN + "i"
-        self.tmpout = test_support.TESTFN + "o"
+        self.tmpin  = support.TESTFN + "i"
+        self.tmpout = support.TESTFN + "o"
 
     def tearDown(self):
         del self.tmpin
@@ -121,7 +121,7 @@ class UUFileTest(unittest.TestCase):
     def test_encode(self):
         fin = fout = None
         try:
-            test_support.unlink(self.tmpin)
+            support.unlink(self.tmpin)
             fin = open(self.tmpin, 'wb')
             fin.write(plaintext)
             fin.close()
@@ -151,7 +151,7 @@ class UUFileTest(unittest.TestCase):
     def test_decode(self):
         f = None
         try:
-            test_support.unlink(self.tmpin)
+            support.unlink(self.tmpin)
             f = open(self.tmpin, 'wb')
             f.write(encodedtextwrapped(0o644, self.tmpout))
             f.close()
@@ -185,7 +185,7 @@ class UUFileTest(unittest.TestCase):
             self._kill(f)
 
 def test_main():
-    test_support.run_unittest(UUTest,
+    support.run_unittest(UUTest,
                               UUStdIOTest,
                               UUFileTest,
                               )
index 92d62946e140f68df7b58a9231f0b80fd16a7208..5a37c2fde31b8f3a5647a4d782ec4f3c181ff2ab 100644 (file)
@@ -1,5 +1,5 @@
 from unittest import TestCase
-from test import test_support
+from test import support
 import uuid
 
 def importable(name):
@@ -462,7 +462,7 @@ class TestUUID(TestCase):
 
 
 def test_main():
-    test_support.run_unittest(TestUUID)
+    support.run_unittest(TestUUID)
 
 if __name__ == '__main__':
     test_main()
index 3adbec4abc33ffbc54d98531725dab73356d29ac..4cca441853a2a3aad7903a9f827c08ede229e482 100644 (file)
@@ -4,7 +4,7 @@
 import os
 import time
 from test.fork_wait import ForkWait
-from test.test_support import TestSkipped, run_unittest, reap_children
+from test.support import TestSkipped, run_unittest, reap_children
 
 try:
     os.fork
index c85944d06a18c3eeac06349578825d28893cb9b1..192fd9404152c8b2c15c9908bcc666312c71950a 100644 (file)
@@ -4,7 +4,7 @@
 import os
 import time
 from test.fork_wait import ForkWait
-from test.test_support import TestSkipped, run_unittest, reap_children
+from test.support import TestSkipped, run_unittest, reap_children
 
 try:
     os.fork
index 7b512ef3d664cd70ce852abebdc147a911e6412e..6fb3c0ea3e25e425d931538b71589cceb6298bb2 100644 (file)
@@ -4,7 +4,7 @@ import os
 from io import StringIO
 import sys
 import unittest
-from test import test_support
+from test import support
 
 from test import warning_tests
 
@@ -72,21 +72,21 @@ class FilterTests(object):
     """Testing the filtering functionality."""
 
     def test_error(self):
-        with test_support.catch_warning(self.module) as w:
+        with support.catch_warning(self.module) as w:
             self.module.resetwarnings()
             self.module.filterwarnings("error", category=UserWarning)
             self.assertRaises(UserWarning, self.module.warn,
                                 "FilterTests.test_error")
 
     def test_ignore(self):
-        with test_support.catch_warning(self.module) as w:
+        with support.catch_warning(self.module) as w:
             self.module.resetwarnings()
             self.module.filterwarnings("ignore", category=UserWarning)
             self.module.warn("FilterTests.test_ignore", UserWarning)
             self.assert_(not w.message)
 
     def test_always(self):
-        with test_support.catch_warning(self.module) as w:
+        with support.catch_warning(self.module) as w:
             self.module.resetwarnings()
             self.module.filterwarnings("always", category=UserWarning)
             message = "FilterTests.test_always"
@@ -97,7 +97,7 @@ class FilterTests(object):
             self.assert_(w.message, message)
 
     def test_default(self):
-        with test_support.catch_warning(self.module) as w:
+        with support.catch_warning(self.module) as w:
             self.module.resetwarnings()
             self.module.filterwarnings("default", category=UserWarning)
             message = UserWarning("FilterTests.test_default")
@@ -112,7 +112,7 @@ class FilterTests(object):
                     raise ValueError("loop variant unhandled")
 
     def test_module(self):
-        with test_support.catch_warning(self.module) as w:
+        with support.catch_warning(self.module) as w:
             self.module.resetwarnings()
             self.module.filterwarnings("module", category=UserWarning)
             message = UserWarning("FilterTests.test_module")
@@ -123,7 +123,7 @@ class FilterTests(object):
             self.assert_(not w.message, "unexpected message: " + str(w))
 
     def test_once(self):
-        with test_support.catch_warning(self.module) as w:
+        with support.catch_warning(self.module) as w:
             self.module.resetwarnings()
             self.module.filterwarnings("once", category=UserWarning)
             message = UserWarning("FilterTests.test_once")
@@ -139,14 +139,14 @@ class FilterTests(object):
             self.assert_(not w.message)
 
     def test_inheritance(self):
-        with test_support.catch_warning(self.module) as w:
+        with support.catch_warning(self.module) as w:
             self.module.resetwarnings()
             self.module.filterwarnings("error", category=Warning)
             self.assertRaises(UserWarning, self.module.warn,
                                 "FilterTests.test_inheritance", UserWarning)
 
     def test_ordering(self):
-        with test_support.catch_warning(self.module) as w:
+        with support.catch_warning(self.module) as w:
             self.module.resetwarnings()
             self.module.filterwarnings("ignore", category=UserWarning)
             self.module.filterwarnings("error", category=UserWarning,
@@ -161,7 +161,7 @@ class FilterTests(object):
     def test_filterwarnings(self):
         # Test filterwarnings().
         # Implicitly also tests resetwarnings().
-        with test_support.catch_warning(self.module) as w:
+        with support.catch_warning(self.module) as w:
             self.module.filterwarnings("error", "", Warning, "", 0)
             self.assertRaises(UserWarning, self.module.warn, 'convert to error')
 
@@ -196,7 +196,7 @@ class WarnTests(unittest.TestCase):
     """Test warnings.warn() and warnings.warn_explicit()."""
 
     def test_message(self):
-        with test_support.catch_warning(self.module) as w:
+        with support.catch_warning(self.module) as w:
             for i in range(4):
                 text = 'multi %d' %i  # Different text on each call.
                 self.module.warn(text)
@@ -205,7 +205,7 @@ class WarnTests(unittest.TestCase):
 
     def test_filename(self):
         with warnings_state(self.module):
-            with test_support.catch_warning(self.module) as w:
+            with support.catch_warning(self.module) as w:
                 warning_tests.inner("spam1")
                 self.assertEqual(os.path.basename(w.filename), "warning_tests.py")
                 warning_tests.outer("spam2")
@@ -215,7 +215,7 @@ class WarnTests(unittest.TestCase):
         # Test stacklevel argument
         # make sure all messages are different, so the warning won't be skipped
         with warnings_state(self.module):
-            with test_support.catch_warning(self.module) as w:
+            with support.catch_warning(self.module) as w:
                 warning_tests.inner("spam3", stacklevel=1)
                 self.assertEqual(os.path.basename(w.filename), "warning_tests.py")
                 warning_tests.outer("spam4", stacklevel=1)
@@ -238,7 +238,7 @@ class WarnTests(unittest.TestCase):
         try:
             del warning_tests.__file__
             with warnings_state(self.module):
-                with test_support.catch_warning(self.module) as w:
+                with support.catch_warning(self.module) as w:
                     warning_tests.inner("spam8", stacklevel=1)
                     self.assertEqual(w.filename, warning_tests.__name__)
         finally:
@@ -255,7 +255,7 @@ class WarnTests(unittest.TestCase):
             del warning_tests.__file__
             warning_tests.__name__ = '__main__'
             with warnings_state(self.module):
-                with test_support.catch_warning(self.module) as w:
+                with support.catch_warning(self.module) as w:
                     warning_tests.inner('spam9', stacklevel=1)
                     self.assertEqual(w.filename, sys.argv[0])
         finally:
@@ -273,7 +273,7 @@ class WarnTests(unittest.TestCase):
             warning_tests.__name__ = '__main__'
             del sys.argv
             with warnings_state(self.module):
-                with test_support.catch_warning(self.module) as w:
+                with support.catch_warning(self.module) as w:
                     warning_tests.inner('spam10', stacklevel=1)
                     self.assertEqual(w.filename, '__main__')
         finally:
@@ -293,7 +293,7 @@ class WarnTests(unittest.TestCase):
             warning_tests.__name__ = '__main__'
             sys.argv = ['']
             with warnings_state(self.module):
-                with test_support.catch_warning(self.module) as w:
+                with support.catch_warning(self.module) as w:
                     warning_tests.inner('spam11', stacklevel=1)
                     self.assertEqual(w.filename, '__main__')
         finally:
@@ -315,7 +315,7 @@ class WCmdLineTests(unittest.TestCase):
     def test_improper_input(self):
         # Uses the private _setoption() function to test the parsing
         # of command-line warning arguments
-        with test_support.catch_warning(self.module):
+        with support.catch_warning(self.module):
             self.assertRaises(self.module._OptionError,
                               self.module._setoption, '1:2:3:4:5:6')
             self.assertRaises(self.module._OptionError,
@@ -340,7 +340,7 @@ class _WarningsTests(BaseTest):
 
     def test_filter(self):
         # Everything should function even if 'filters' is not in warnings.
-        with test_support.catch_warning(self.module) as w:
+        with support.catch_warning(self.module) as w:
             self.module.filterwarnings("error", "", Warning, "", 0)
             self.assertRaises(UserWarning, self.module.warn,
                                 'convert to error')
@@ -355,7 +355,7 @@ class _WarningsTests(BaseTest):
         try:
             original_registry = self.module.onceregistry
             __warningregistry__ = {}
-            with test_support.catch_warning(self.module) as w:
+            with support.catch_warning(self.module) as w:
                 self.module.resetwarnings()
                 self.module.filterwarnings("once", category=UserWarning)
                 self.module.warn_explicit(message, UserWarning, "file", 42)
@@ -380,10 +380,10 @@ class _WarningsTests(BaseTest):
     def test_showwarning_missing(self):
         # Test that showwarning() missing is okay.
         text = 'del showwarning test'
-        with test_support.catch_warning(self.module):
+        with support.catch_warning(self.module):
             self.module.filterwarnings("always", category=UserWarning)
             del self.module.showwarning
-            with test_support.captured_output('stderr') as stream:
+            with support.captured_output('stderr') as stream:
                 self.module.warn(text)
                 result = stream.getvalue()
         self.failUnless(text in result)
@@ -401,10 +401,10 @@ class _WarningsTests(BaseTest):
     def test_show_warning_output(self):
         # With showarning() missing, make sure that output is okay.
         text = 'test show_warning'
-        with test_support.catch_warning(self.module):
+        with support.catch_warning(self.module):
             self.module.filterwarnings("always", category=UserWarning)
             del self.module.showwarning
-            with test_support.captured_output('stderr') as stream:
+            with support.captured_output('stderr') as stream:
                 warning_tests.inner(text)
                 result = stream.getvalue()
         self.failUnlessEqual(result.count('\n'), 2,
@@ -476,7 +476,7 @@ class PyWarningsDisplayTests(BaseTest, WarningsDisplayTests):
 def test_main():
     py_warnings.onceregistry.clear()
     c_warnings.onceregistry.clear()
-    test_support.run_unittest(CFilterTests,
+    support.run_unittest(CFilterTests,
                                 PyFilterTests,
                                 CWarnTests,
                                 PyWarnTests,
index c37323a21b38042fa68ad668f76871f613342004..a7746fd8c24087204f4d58b172e4356d6ea2ca8b 100644 (file)
@@ -1,4 +1,4 @@
-from test.test_support import TESTFN, run_unittest
+from test.support import TESTFN, run_unittest
 import os
 import wave
 import unittest
index 7de7b77d094c48798b86146dc5f52fad04dd9246..303345befef8dabd020f09abce52d538a67866e6 100644 (file)
@@ -4,7 +4,7 @@ import unittest
 import collections
 import weakref
 
-from test import test_support
+from test import support
 
 # Used in ReferencesTestCase.test_ref_created_during_del() .
 ref_from_del = None
@@ -1145,13 +1145,13 @@ OK
 __test__ = {'libreftest' : libreftest}
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         ReferencesTestCase,
         MappingTestCase,
         WeakValueDictionaryTestCase,
         WeakKeyDictionaryTestCase,
         )
-    test_support.run_doctest(sys.modules[__name__])
+    support.run_doctest(sys.modules[__name__])
 
 
 if __name__ == "__main__":
index 7f5b8eb544fa3e48f4c81fb718870416f9753e4b..cff20455566e6689533ba2965ccc7842d661327d 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 from weakref import proxy, ref, WeakSet
 import operator
 import copy
@@ -306,7 +306,7 @@ class TestWeakSet(unittest.TestCase):
 
 
 def test_main(verbose=None):
-    test_support.run_unittest(TestWeakSet)
+    support.run_unittest(TestWeakSet)
 
 if __name__ == "__main__":
     test_main(verbose=True)
index e63eb0fe769a38fc1503894de7a7d7c149e9e29b..d908ac5b3bdf2343c52b477fafe1a7f7f682e726 100644 (file)
@@ -4,14 +4,14 @@
 """
 
 import os
-import test.test_support
+import test.support
 import unittest
 import whichdb
 import anydbm
 import glob
 from test.test_anydbm import delete_files, dbm_iterator
 
-_fname = test.test_support.TESTFN
+_fname = test.support.TESTFN
 
 class WhichDBTestCase(unittest.TestCase):
     # Actual test methods are added to namespace
@@ -27,7 +27,7 @@ class WhichDBTestCase(unittest.TestCase):
             name = module.__name__
             if name == 'dumbdbm':
                 continue   # whichdb can't support dumbdbm
-            test.test_support.unlink(_fname)
+            test.support.unlink(_fname)
             f = module.open(_fname, 'c')
             f.close()
             self.assertEqual(name, whichdb.whichdb(_fname))
@@ -50,7 +50,7 @@ class WhichDBTestCase(unittest.TestCase):
 
 def test_main():
     try:
-        test.test_support.run_unittest(WhichDBTestCase)
+        test.support.run_unittest(WhichDBTestCase)
     finally:
         delete_files()
 
index 174d7bcee80f35e805be88bfdaceee7dbda2d98c..e852c69684ce4aa77ea4967a1a909025a2219762 100644 (file)
@@ -6,7 +6,7 @@ from _winreg import *
 import os, sys
 import unittest
 
-from test import test_support
+from test import support
 
 test_key_name = "SOFTWARE\\Python Registry Test Key - Delete Me"
 
@@ -161,7 +161,7 @@ class WinregTests(unittest.TestCase):
         self.assertEqual(r, os.environ["windir"] + "\\test")
 
 def test_main():
-    test_support.run_unittest(WinregTests)
+    support.run_unittest(WinregTests)
 
 if __name__ == "__main__":
     try:
index bc21d7eed1cddfb523eb94408c401c5aa7f43a2f..c39a233ca8fd52fc4f4afd9c7eef54547f1d6052 100644 (file)
@@ -1,8 +1,8 @@
 # Ridiculously simple test of the winsound module for Windows.
 
 import unittest
-from test import test_support
-test_support.requires('audio')
+from test import support
+support.requires('audio')
 import winsound, time
 import os
 import subprocess
@@ -226,7 +226,7 @@ def _have_soundcard():
 
 
 def test_main():
-    test_support.run_unittest(BeepTest, MessageBeepTest, PlaySoundTest)
+    support.run_unittest(BeepTest, MessageBeepTest, PlaySoundTest)
 
 if __name__=="__main__":
     test_main()
index 6e439ac7a13d6ca3ae26a610dea65db96614e736..43f327122854cd7502c19dfd86ccc66674db3b2a 100644 (file)
@@ -10,7 +10,7 @@ import sys
 import unittest
 from collections import deque
 from contextlib import GeneratorContextManager, contextmanager
-from test.test_support import run_unittest
+from test.support import run_unittest
 
 
 class MockContextManager(GeneratorContextManager):
index a5e0b27796f82659da27ecde5c09a10b51ce9dbc..ac5ada3b99dc676e0ad0c7528bb3a5cd367d9a1e 100755 (executable)
@@ -11,7 +11,7 @@ from io import StringIO, BytesIO, BufferedReader
 from socketserver import BaseServer
 import re, sys
 
-from test import test_support
+from test import support
 
 class MockServer(WSGIServer):
     """Non-socket HTTP server"""
@@ -578,7 +578,7 @@ class HandlerTests(TestCase):
 # This epilogue is needed for compatibility with the Python 2.5 regrtest module
 
 def test_main():
-    test_support.run_unittest(__name__)
+    support.run_unittest(__name__)
 
 if __name__ == "__main__":
     test_main()
index 44d5a82c71ee76e3096b9ecc67abc093c92ed509..11a44ff93beff94a8d8dcbfef90926a00a6a6c16 100644 (file)
@@ -1,4 +1,4 @@
-from test import test_support
+from test import support
 import unittest
 
 import xdrlib
@@ -50,7 +50,7 @@ class XDRTest(unittest.TestCase):
         self.assertRaises(EOFError, up.unpack_uint)
 
 def test_main():
-    test_support.run_unittest(XDRTest)
+    support.run_unittest(XDRTest)
 
 if __name__ == "__main__":
     test_main()
index 84705841e079cd13e0038d24dd7b28a9b555d446..895902f02f36a06dfaaf533da96b008f1924ef35 100644 (file)
@@ -5,7 +5,7 @@
 import doctest
 import sys
 
-from test import test_support
+from test import support
 
 SAMPLE_XML = """
 <body>
@@ -345,7 +345,7 @@ def xinclude():
 
 def test_main():
     from test import test_xml_etree
-    test_support.run_doctest(test_xml_etree, verbosity=True)
+    support.run_doctest(test_xml_etree, verbosity=True)
 
 if __name__ == '__main__':
     test_main()
index 80e91d14afe45dee6726d6de9137ab01a1f19091..4d28d01222263195992ec012381a67998651d829 100644 (file)
@@ -3,7 +3,7 @@
 import doctest
 import sys
 
-from test import test_support
+from test import support
 
 from xml.etree import cElementTree as ET
 
@@ -214,7 +214,7 @@ def bug_1534630():
 
 def test_main():
     from test import test_xml_etree_c
-    test_support.run_doctest(test_xml_etree_c, verbosity=True)
+    support.run_doctest(test_xml_etree_c, verbosity=True)
 
 if __name__ == '__main__':
     test_main()
index 7ff078db919dcf3006fcf8fa067426b08841d31e..cad2b9dc3b0f6f04ff5bec46c02f0409e1483b7c 100644 (file)
@@ -10,7 +10,7 @@ import mimetools
 import httplib
 import socket
 import os
-from test import test_support
+from test import support
 
 alist = [{'astring': 'foo@bar.baz.spam',
           'afloat': 7283.43,
@@ -546,20 +546,20 @@ class CGIHandlerTestCase(unittest.TestCase):
         # if the method is GET and no request_text is given, it runs handle_get
         # get sysout output
         tmp = sys.stdout
-        sys.stdout = open(test_support.TESTFN, "w")
+        sys.stdout = open(support.TESTFN, "w")
         self.cgi.handle_request()
         sys.stdout.close()
         sys.stdout = tmp
 
         # parse Status header
-        handle = open(test_support.TESTFN, "r").read()
+        handle = open(support.TESTFN, "r").read()
         status = handle.split()[1]
         message = ' '.join(handle.split()[2:4])
 
         self.assertEqual(status, '400')
         self.assertEqual(message, 'Bad Request')
 
-        os.remove(test_support.TESTFN)
+        os.remove(support.TESTFN)
         os.environ['REQUEST_METHOD'] = ''
 
     def test_cgi_xmlrpc_response(self):
@@ -581,7 +581,7 @@ class CGIHandlerTestCase(unittest.TestCase):
         tmp2 = sys.stdout
 
         sys.stdin = open("xmldata.txt", "r")
-        sys.stdout = open(test_support.TESTFN, "w")
+        sys.stdout = open(support.TESTFN, "w")
 
         self.cgi.handle_request()
 
@@ -591,13 +591,13 @@ class CGIHandlerTestCase(unittest.TestCase):
         sys.stdout = tmp2
 
         # will respond exception, if so, our goal is achieved ;)
-        handle = open(test_support.TESTFN, "r").read()
+        handle = open(support.TESTFN, "r").read()
 
         # start with 44th char so as not to get http header, we just need only xml
         self.assertRaises(xmlrpclib.Fault, xmlrpclib.loads, handle[44:])
 
         os.remove("xmldata.txt")
-        os.remove(test_support.TESTFN)
+        os.remove(support.TESTFN)
 
 def test_main():
     xmlrpc_tests = [XMLRPCTestCase, HelperTestCase, DateTimeTestCase,
@@ -612,7 +612,7 @@ def test_main():
         xmlrpc_tests.append(FailingServerTestCase)
         xmlrpc_tests.append(CGIHandlerTestCase)
 
-    test_support.run_unittest(*xmlrpc_tests)
+    support.run_unittest(*xmlrpc_tests)
 
 if __name__ == "__main__":
     test_main()
index e62fcb6faebb338ba865fc3aac2204cb1c824b89..1f8dd5d1e53fe733001793b0df2e8cf6096b4732 100644 (file)
@@ -4,7 +4,7 @@ import errno
 import socket
 import sys
 import unittest
-from test import test_support
+from test import support
 
 import xmlrpclib
 
@@ -37,8 +37,8 @@ class CurrentTimeTest(unittest.TestCase):
 
 
 def test_main():
-    test_support.requires("network")
-    test_support.run_unittest(CurrentTimeTest)
+    support.requires("network")
+    support.run_unittest(CurrentTimeTest)
 
 if __name__ == "__main__":
     test_main()
index 6878262556de29f7e5ac302d2f4ed3189d9dd437..30efeb964a8d67d65f8748081e7b91c4eff18030 100644 (file)
@@ -8,8 +8,8 @@ import zipfile, os, unittest, sys, shutil, struct, io
 from tempfile import TemporaryFile
 from random import randint, random
 
-import test.test_support as support
-from test.test_support import TESTFN, run_unittest
+import test.support as support
+from test.support import TESTFN, run_unittest
 
 TESTFN2 = TESTFN + "2"
 FIXEDTEST_SIZE = 1000
index a008fd03130b46c6ce922eb182b1f250aba31417..343fd4f0e295d74f2916c29e98ca536c4f64a54b 100644 (file)
@@ -1,11 +1,11 @@
 # Tests of the full ZIP64 functionality of zipfile
-# The test_support.requires call is the only reason for keeping this separate
+# The support.requires call is the only reason for keeping this separate
 # from test_zipfile
-from test import test_support
+from test import support
 # XXX(nnorwitz): disable this test by looking for extra largfile resource
 # which doesn't exist.  This test takes over 30 minutes to run in general
 # and requires more disk space than most of the buildbots.
-test_support.requires(
+support.requires(
         'extralargefile',
         'test requires loads of disk-space bytes and a long time to run'
     )
@@ -23,7 +23,7 @@ import sys
 from io import StringIO
 from tempfile import TemporaryFile
 
-from test.test_support import TESTFN, run_unittest
+from test.support import TESTFN, run_unittest
 
 TESTFN2 = TESTFN + "2"
 
index c7da859e6e33b5d3b33a0e21e21442b0625bbcf7..754476a6955bc9af417f261c8299778bea07c281 100644 (file)
@@ -8,7 +8,7 @@ import unittest
 
 import zlib # implied prerequisite
 from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED
-from test import test_support
+from test import support
 from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co
 
 import zipimport
@@ -385,12 +385,12 @@ class BadFileZipImportTestCase(unittest.TestCase):
         self.assertZipFailure('A' * 33000)
 
     def testEmptyFile(self):
-        test_support.unlink(TESTMOD)
+        support.unlink(TESTMOD)
         open(TESTMOD, 'w+').close()
         self.assertZipFailure(TESTMOD)
 
     def testFileUnreadable(self):
-        test_support.unlink(TESTMOD)
+        support.unlink(TESTMOD)
         fd = os.open(TESTMOD, os.O_CREAT, 000)
         try:
             os.close(fd)
@@ -399,10 +399,10 @@ class BadFileZipImportTestCase(unittest.TestCase):
             # If we leave "the read-only bit" set on Windows, nothing can
             # delete TESTMOD, and later tests suffer bogus failures.
             os.chmod(TESTMOD, 0o666)
-            test_support.unlink(TESTMOD)
+            support.unlink(TESTMOD)
 
     def testNotZipFile(self):
-        test_support.unlink(TESTMOD)
+        support.unlink(TESTMOD)
         fp = open(TESTMOD, 'w+')
         fp.write('a' * 22)
         fp.close()
@@ -410,7 +410,7 @@ class BadFileZipImportTestCase(unittest.TestCase):
 
     # XXX: disabled until this works on Big-endian machines
     def _testBogusZipFile(self):
-        test_support.unlink(TESTMOD)
+        support.unlink(TESTMOD)
         fp = open(TESTMOD, 'w+')
         fp.write(struct.pack('=I', 0x06054B50))
         fp.write('a' * 18)
@@ -451,13 +451,13 @@ def cleanup():
 def test_main():
     cleanup()
     try:
-        test_support.run_unittest(
+        support.run_unittest(
               UncompressedZipImportTestCase,
               CompressedZipImportTestCase,
               BadFileZipImportTestCase,
             )
     finally:
-        test_support.unlink(TESTMOD)
+        support.unlink(TESTMOD)
 
 if __name__ == "__main__":
     test_main()
index 4fa263d11813dcc467e3c455cf6c4a84cc1b74fb..485ffdc2fb33ca25c5f71090e4865be34c75616e 100644 (file)
@@ -1,5 +1,5 @@
 import unittest
-from test import test_support
+from test import support
 import zlib
 import binascii
 import random
@@ -460,7 +460,7 @@ LAERTES
 
 
 def test_main():
-    test_support.run_unittest(
+    support.run_unittest(
         ChecksumTestCase,
         ExceptionTestCase,
         CompressTestCase,
index 446fe308a1995c2600e715865c9201d3ed9273c5..0bfcba181e825f806eec7759eaec15334d31c907 100644 (file)
@@ -2,9 +2,9 @@
 # standard library.
 
 import sys
-import test.test_support
+import test.support
 
-test.test_support.verbose = 0
+test.support.verbose = 0
 
 def runtest(name):
     __import__(name)
index 0e986c83bd712d4bd4bc13f2efec108587a371bc..161485fda99abbcad7311b2a92296dbfced2c050 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -104,6 +104,8 @@ Library
 
 - pdb gained the "until" command.
 
+- test.test_support has been renamed test.support
+
 Build
 -----