#2621 rename test.test_support to test.support

This commit is contained in:
Benjamin Peterson 2008-05-20 21:35:26 +00:00
parent 6a654814ea
commit ee8712cda4
358 changed files with 1308 additions and 1307 deletions

View 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])

View 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
#----------------------------------------------------------------------

View 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'

View 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

View 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
#----------------------------------------------------------------------

View 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
#----------------------------------------------------------------------

View 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

View 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
#----------------------------------------------------------------------

View 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

View 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
#----------------------------------------------------------------------

View 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
#----------------------------------------------------------------------

View 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
#----------------------------------------------------------------------

View 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
#----------------------------------------------------------------------

View 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'

View 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):

View 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
#----------------------------------------------------------------------

View 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))

View 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):

View 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):

View 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

View 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

View 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

View 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)

View 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

View 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))

View 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__":

View 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

View File

@ -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:

View 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:

View 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).
"""

View 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()

View 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

View 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()

View 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

View 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__":

View 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__":

View 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()

View File

@ -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)

View 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__':

View 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__":

View 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)

View 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()

View 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'

View File

@ -1,6 +1,6 @@
# Augmented assignment test.
from test.test_support import run_unittest
from test.support import run_unittest
import unittest

View 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):
def test_main():
test_support.run_unittest(__name__)
support.run_unittest(__name__)
if __name__ == '__main__':
test_main()

View 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()

View 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()

View File

@ -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()

View File

@ -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__":

View 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__":

View 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)

View 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()

View File

@ -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,

View 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.

View 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()

View 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

View 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()

View 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()

View 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')

View 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,

View 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__":

View 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:

View 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,

View File

@ -1,4 +1,4 @@
from test.test_support import run_unittest
from test.support import run_unittest
import cgi
import os
import sys

View 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()

View 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()

View File

@ -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

View 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,],

View 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()

View 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()

View 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)

View 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()

View 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()

View 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()

View 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()

View 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()

View 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()

View 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()

View 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()

View 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()

View 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()

View 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()

View 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,

View 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

View 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()

View 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__":

View 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()

View 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:

View 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()

View 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()

View 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()

View File

@ -1,4 +1,4 @@
from test.test_support import run_unittest
from test.support import run_unittest
import unittest

View 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()

View 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

View 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,

View 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()

View 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__":

View File

@ -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()

View 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')]
)

View 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():

Some files were not shown because too many files have changed in this diff Show More