Issue #21741: Update 147 test modules to use test discovery.

I have compared output between pre- and post-patch runs of these tests
to make sure there's nothing missing and nothing broken, on both
Windows and Linux.  The only differences I found were actually tests
that were previously *not* run.
This commit is contained in:
Zachary Ware 2015-04-13 15:00:43 -05:00
parent 4b761bf79a
commit 38c707e7e0
148 changed files with 184 additions and 866 deletions

View file

@ -3885,8 +3885,5 @@ class Oddballs(unittest.TestCase):
with self.assertRaises(TypeError): with self.assertRaises(TypeError):
datetime(10, 10, 10, 10, 10, 10, 10.) datetime(10, 10, 10, 10, 10, 10, 10.)
def test_main():
support.run_unittest(__name__)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,5 +1,4 @@
import unittest import unittest
from test import support
import __future__ import __future__
GOOD_SERIALS = ("alpha", "beta", "candidate", "final") GOOD_SERIALS = ("alpha", "beta", "candidate", "final")
@ -58,8 +57,5 @@ class FutureTest(unittest.TestCase):
".compiler_flag isn't int") ".compiler_flag isn't int")
def test_main():
support.run_unittest(FutureTest)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,5 +1,5 @@
import dis import dis
from test.support import run_unittest, import_module from test.support import import_module
import unittest import unittest
_opcode = import_module("_opcode") _opcode = import_module("_opcode")
@ -16,8 +16,5 @@ class OpcodeTests(unittest.TestCase):
self.assertRaises(ValueError, _opcode.stack_effect, dis.opmap['BUILD_SLICE']) self.assertRaises(ValueError, _opcode.stack_effect, dis.opmap['BUILD_SLICE'])
self.assertRaises(ValueError, _opcode.stack_effect, dis.opmap['POP_TOP'], 0) self.assertRaises(ValueError, _opcode.stack_effect, dis.opmap['POP_TOP'], 0)
def test_main():
run_unittest(OpcodeTests)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -273,9 +273,5 @@ class Test_OSXSupport(unittest.TestCase):
result = _osx_support.get_platform_osx(config_vars, ' ', ' ', ' ') result = _osx_support.get_platform_osx(config_vars, ' ', ' ', ' ')
self.assertEqual(('macosx', '10.6', 'fat'), result) self.assertEqual(('macosx', '10.6', 'fat'), result)
def test_main():
if sys.platform == 'darwin':
test.support.run_unittest(Test_OSXSupport)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -177,9 +177,5 @@ class SubinterpreterTest(unittest.TestCase):
self.assertEqual(atexit._ncallbacks(), n) self.assertEqual(atexit._ncallbacks(), n)
def test_main():
support.run_unittest(__name__)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,6 +1,5 @@
# Augmented assignment test. # Augmented assignment test.
from test.support import run_unittest
import unittest import unittest
@ -315,8 +314,5 @@ __rlshift__ called
__ilshift__ called __ilshift__ called
'''.splitlines()) '''.splitlines())
def test_main():
run_unittest(AugAssignTest)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -1,6 +1,5 @@
"""Test the binascii C module.""" """Test the binascii C module."""
from test import support
import unittest import unittest
import binascii import binascii
import array import array
@ -262,11 +261,5 @@ class MemoryviewBinASCIITest(BinASCIITest):
type2test = memoryview type2test = memoryview
def test_main():
support.run_unittest(BinASCIITest,
ArrayBinASCIITest,
BytearrayBinASCIITest,
MemoryviewBinASCIITest)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -369,8 +369,5 @@ class OperationOrderTests(unittest.TestCase):
self.assertEqual(op_sequence(le, B, C), ['C.__ge__', 'B.__le__']) self.assertEqual(op_sequence(le, B, C), ['C.__ge__', 'B.__le__'])
self.assertEqual(op_sequence(le, C, B), ['C.__le__', 'B.__ge__']) self.assertEqual(op_sequence(le, C, B), ['C.__le__', 'B.__ge__'])
def test_main():
support.run_unittest(RatTestCase, OperationOrderTests)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,5 +1,4 @@
import unittest import unittest
from test import support
# The test cases here cover several paths through the function calling # 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 # code. They depend on the METH_XXX flag that is used to define a C
@ -123,9 +122,5 @@ class CFunctionCalls(unittest.TestCase):
self.assertRaises(TypeError, [].count, x=2, y=2) self.assertRaises(TypeError, [].count, x=2, y=2)
def test_main():
support.run_unittest(CFunctionCalls)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,4 +1,3 @@
from test.support import run_unittest
from test.script_helper import assert_python_failure, temp_dir from test.script_helper import assert_python_failure, temp_dir
import unittest import unittest
import sys import sys
@ -63,8 +62,5 @@ class TestCgitb(unittest.TestCase):
self.assertNotIn('</p>', out) self.assertNotIn('</p>', out)
def test_main():
run_unittest(TestCgitb)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -49,8 +49,5 @@ class CharmapCodecTest(unittest.TestCase):
def test_maptoundefined(self): def test_maptoundefined(self):
self.assertRaises(UnicodeError, str, b'abc\001', codecname) self.assertRaises(UnicodeError, str, b'abc\001', codecname)
def test_main():
test.support.run_unittest(CharmapCodecTest)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -2,7 +2,6 @@
import unittest import unittest
from test import support
testmeths = [ testmeths = [
@ -569,8 +568,5 @@ class ClassTests(unittest.TestCase):
a = A(hash(A.f)^(-1)) a = A(hash(A.f)^(-1))
hash(a.f) hash(a.f)
def test_main(): if __name__ == '__main__':
support.run_unittest(ClassTests) unittest.main()
if __name__=='__main__':
test_main()

View file

@ -1,4 +1,4 @@
from test.support import run_unittest, requires_IEEE_754 from test.support import requires_IEEE_754
from test.test_math import parse_testfile, test_file from test.test_math import parse_testfile, test_file
import unittest import unittest
import cmath, math import cmath, math
@ -529,8 +529,5 @@ class CMathTests(unittest.TestCase):
self.assertComplexIdentical(cmath.atanh(z), z) self.assertComplexIdentical(cmath.atanh(z), z)
def test_main():
run_unittest(CMathTests)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -114,8 +114,5 @@ class TestInteractiveConsole(unittest.TestCase):
self.assertIn(expected, output) self.assertIn(expected, output)
def test_main():
support.run_unittest(TestInteractiveConsole)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()

View file

@ -83,8 +83,5 @@ class Test_HZ(multibytecodec_support.TestBase, unittest.TestCase):
(b"ab~{\x79\x79\x41\x44~}cd", "replace", "ab\ufffd\ufffd\u804acd"), (b"ab~{\x79\x79\x41\x44~}cd", "replace", "ab\ufffd\ufffd\u804acd"),
) )
def test_main():
support.run_unittest(__name__)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -19,8 +19,5 @@ class Test_Big5HKSCS(multibytecodec_support.TestBase, unittest.TestCase):
(b"abc\x80\x80\xc1\xc4", "ignore", "abc\u8b10"), (b"abc\x80\x80\xc1\xc4", "ignore", "abc\u8b10"),
) )
def test_main():
support.run_unittest(__name__)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -38,8 +38,5 @@ class Test_ISO2022_KR(multibytecodec_support.TestBase, unittest.TestCase):
def test_chunkcoding(self): def test_chunkcoding(self):
pass pass
def test_main():
support.run_unittest(__name__)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -123,8 +123,5 @@ class Test_SJISX0213(multibytecodec_support.TestBase, unittest.TestCase):
b"\x85G&real;\x85Q = &lang;&#4660;&rang;" b"\x85G&real;\x85Q = &lang;&#4660;&rang;"
) )
def test_main():
support.run_unittest(__name__)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -66,8 +66,5 @@ class Test_JOHAB(multibytecodec_support.TestBase, unittest.TestCase):
(b"\x8CBxy", "replace", "\uFFFDBxy"), (b"\x8CBxy", "replace", "\uFFFDBxy"),
) )
def test_main():
support.run_unittest(__name__)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -19,8 +19,5 @@ class Test_Big5(multibytecodec_support.TestBase, unittest.TestCase):
(b"abc\x80\x80\xc1\xc4", "ignore", "abc\u8b10"), (b"abc\x80\x80\xc1\xc4", "ignore", "abc\u8b10"),
) )
def test_main():
support.run_unittest(__name__)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -3,7 +3,7 @@
Nick Mathewson Nick Mathewson
""" """
import unittest import unittest
from test.support import run_unittest, is_jython from test.support import is_jython
from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT
import io import io
@ -296,9 +296,5 @@ class CodeopTests(unittest.TestCase):
compile("a = 1\n", "def", 'single').co_filename) compile("a = 1\n", "def", 'single').co_filename)
def test_main():
run_unittest(CodeopTests)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,5 +1,4 @@
import unittest import unittest
from test import support
class Empty: class Empty:
def __repr__(self): def __repr__(self):
@ -121,8 +120,5 @@ class ComparisonTest(unittest.TestCase):
self.assertEqual(Anything(), y) self.assertEqual(Anything(), y)
def test_main():
support.run_unittest(ComparisonTest)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -1,5 +1,4 @@
from collections import deque from collections import deque
from test.support import run_unittest
import unittest import unittest
@ -86,8 +85,5 @@ class TestContains(unittest.TestCase):
self.assertTrue(container == container) self.assertTrue(container == container)
def test_main():
run_unittest(TestContains)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -7,7 +7,6 @@ import abc
from operator import le, lt, ge, gt, eq, ne from operator import le, lt, ge, gt, eq, ne
import unittest import unittest
from test import support
order_comparisons = le, lt, ge, gt order_comparisons = le, lt, ge, gt
equality_comparisons = eq, ne equality_comparisons = eq, ne
@ -822,8 +821,5 @@ class TestCopy(unittest.TestCase):
def global_foo(x, y): return x+y def global_foo(x, y): return x+y
def test_main():
support.run_unittest(TestCopy)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,7 +1,6 @@
import copyreg import copyreg
import unittest import unittest
from test import support
from test.pickletester import ExtensionSaver from test.pickletester import ExtensionSaver
class C: class C:
@ -113,9 +112,5 @@ class CopyRegTestCase(unittest.TestCase):
self.assertEqual(result, expected) self.assertEqual(result, expected)
def test_main():
support.run_unittest(CopyRegTestCase)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -30,9 +30,8 @@ class CrasherTest(unittest.TestCase):
assert_python_failure(fname) assert_python_failure(fname)
def test_main(): def tearDownModule():
test.support.run_unittest(CrasherTest)
test.support.reap_children() test.support.reap_children()
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1084,11 +1084,5 @@ class TestUnicode(unittest.TestCase):
self.assertEqual(fileobj.read(), expected) self.assertEqual(fileobj.read(), expected)
def test_main():
mod = sys.modules[__name__]
support.run_unittest(
*[getattr(mod, name) for name in dir(mod) if name.startswith('Test')]
)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -1,5 +1,4 @@
import unittest import unittest
from test import support
def funcattrs(**kwds): def funcattrs(**kwds):
def decorate(func): def decorate(func):
@ -301,9 +300,5 @@ class TestClassDecorators(unittest.TestCase):
class C(object): pass class C(object): pass
self.assertEqual(C.extra, 'second') self.assertEqual(C.extra, 'second')
def test_main(): if __name__ == "__main__":
support.run_unittest(TestDecorators) unittest.main()
support.run_unittest(TestClassDecorators)
if __name__=="__main__":
test_main()

View file

@ -5,7 +5,6 @@ import copy
import pickle import pickle
import tempfile import tempfile
import unittest import unittest
from test import support
from collections import defaultdict from collections import defaultdict
@ -184,8 +183,5 @@ class TestDefaultDict(unittest.TestCase):
o = pickle.loads(s) o = pickle.loads(s)
self.assertEqual(d, o) self.assertEqual(d, o)
def test_main():
support.run_unittest(TestDefaultDict)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -949,12 +949,5 @@ class Dict(dict):
class SubclassMappingTests(mapping_tests.BasicTestMappingProtocol): class SubclassMappingTests(mapping_tests.BasicTestMappingProtocol):
type2test = Dict type2test = Dict
def test_main():
support.run_unittest(
DictTest,
GeneralMappingTests,
SubclassMappingTests,
)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,5 +1,4 @@
import unittest import unittest
from test import support
class DictSetTest(unittest.TestCase): class DictSetTest(unittest.TestCase):
@ -199,8 +198,5 @@ class DictSetTest(unittest.TestCase):
self.assertRaises(RuntimeError, repr, d) self.assertRaises(RuntimeError, repr, d)
def test_main():
support.run_unittest(DictSetTest)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,6 +1,6 @@
# Minimal tests for dis module # Minimal tests for dis module
from test.support import run_unittest, captured_stdout from test.support import captured_stdout
from test.bytecode_helper import BytecodeTestCase from test.bytecode_helper import BytecodeTestCase
import difflib import difflib
import unittest import unittest

View file

@ -213,8 +213,5 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase):
response.read()) response.read())
def test_main():
support.run_unittest(DocXMLRPCHTTPGETServer)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -56,9 +56,5 @@ class DummyThreadingTestCase(unittest.TestCase):
if support.verbose: if support.verbose:
print('all tasks done') print('all tasks done')
def test_main():
support.run_unittest(DummyThreadingTestCase)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -4,7 +4,7 @@ import builtins
import contextlib import contextlib
import unittest import unittest
from test.support import run_unittest, swap_item, swap_attr from test.support import swap_item, swap_attr
class RebindBuiltinsTests(unittest.TestCase): class RebindBuiltinsTests(unittest.TestCase):
@ -135,9 +135,5 @@ class RebindBuiltinsTests(unittest.TestCase):
self.assertEqual(foo(), 7) self.assertEqual(foo(), 7)
def test_main():
run_unittest(RebindBuiltinsTests)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -4,7 +4,6 @@
import abc import abc
import sys import sys
import unittest import unittest
from test.support import run_unittest
from types import DynamicClassAttribute from types import DynamicClassAttribute
class PropertyBase(Exception): class PropertyBase(Exception):
@ -297,8 +296,5 @@ class PropertySubclassTests(unittest.TestCase):
def test_main():
run_unittest(PropertyTests, PropertySubclassTests)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -342,4 +342,4 @@ class TestUninstallationMainFunction(EnsurepipMixin, unittest.TestCase):
if __name__ == "__main__": if __name__ == "__main__":
test.support.run_unittest(__name__) unittest.main()

View file

@ -258,16 +258,5 @@ class TestLongStart(EnumerateStartTestCase):
(sys.maxsize+3,'c')] (sys.maxsize+3,'c')]
def test_main(verbose=None):
support.run_unittest(__name__)
# verify reference counting
if verbose and hasattr(sys, "gettotalrefcount"):
counts = [None] * 5
for i in range(len(counts)):
support.run_unittest(__name__)
counts[i] = sys.gettotalrefcount()
print(counts)
if __name__ == "__main__": if __name__ == "__main__":
test_main(verbose=True) unittest.main()

View file

@ -24,8 +24,5 @@ class EOFTestCase(unittest.TestCase):
else: else:
raise support.TestFailed raise support.TestFailed
def test_main():
support.run_unittest(EOFTestCase)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -252,8 +252,5 @@ class TestEPoll(unittest.TestCase):
self.assertEqual(os.get_inheritable(epoll.fileno()), False) self.assertEqual(os.get_inheritable(epoll.fileno()), False)
def test_main():
support.run_unittest(TestEPoll)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -3,7 +3,6 @@
""" """
import errno import errno
from test import support
import unittest import unittest
std_c_errors = frozenset(['EDOM', 'ERANGE']) std_c_errors = frozenset(['EDOM', 'ERANGE'])
@ -32,9 +31,5 @@ class ErrorcodeTests(unittest.TestCase):
'no %s attr in errno.errorcode' % attribute) 'no %s attr in errno.errorcode' % attribute)
def test_main():
support.run_unittest(ErrnoAttributeTests, ErrorcodeTests)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -1,5 +1,4 @@
from test.support import run_unittest
import unittest import unittest
class ExceptionTestCase(unittest.TestCase): class ExceptionTestCase(unittest.TestCase):
@ -173,8 +172,5 @@ class ExceptionTestCase(unittest.TestCase):
self.assertTrue(hit_finally) self.assertTrue(hit_finally)
self.assertTrue(hit_except) self.assertTrue(hit_except)
def test_main():
run_unittest(ExceptionTestCase)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -13,7 +13,6 @@ import select
import signal import signal
import subprocess import subprocess
import sys import sys
from test.support import run_unittest
import time import time
import unittest import unittest
@ -249,12 +248,5 @@ class PyTestTextIOSignalInterrupt(TestTextIOSignalInterrupt, unittest.TestCase):
modname = '_pyio' modname = '_pyio'
def test_main():
test_cases = [
tc for tc in globals().values()
if isinstance(tc, type) and issubclass(tc, unittest.TestCase)]
run_unittest(*test_cases)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -515,8 +515,5 @@ class LegacyFinalizationTest(TestBase, unittest.TestCase):
self.assertIs(wr(), None) self.assertIs(wr(), None)
def test_main():
support.run_unittest(__name__)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1299,18 +1299,5 @@ class HexFloatTestCase(unittest.TestCase):
self.identical(x, fromHex(toHex(x))) self.identical(x, fromHex(toHex(x)))
def test_main():
support.run_unittest(
GeneralFloatCases,
FormatFunctionsTestCase,
UnknownFormatTestCase,
IEEEFormatTestCase,
FormatTestCase,
ReprTestCase,
RoundTestCase,
InfNanTest,
HexFloatTestCase,
)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -18,10 +18,5 @@ class FLUFLTests(unittest.TestCase):
'<FLUFL test>', 'exec') '<FLUFL test>', 'exec')
def test_main():
from test.support import run_unittest
run_unittest(FLUFLTests)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -1,6 +1,5 @@
"""Test cases for the fnmatch module.""" """Test cases for the fnmatch module."""
from test import support
import unittest import unittest
from fnmatch import fnmatch, fnmatchcase, translate, filter from fnmatch import fnmatch, fnmatchcase, translate, filter
@ -79,11 +78,5 @@ class FilterTestCase(unittest.TestCase):
self.assertEqual(filter(['a', 'b'], 'a'), ['a']) self.assertEqual(filter(['a', 'b'], 'a'), ['a'])
def test_main():
support.run_unittest(FnmatchTestCase,
TranslateTestCase,
FilterTestCase)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -8,7 +8,7 @@ import sys
import time import time
from test.fork_wait import ForkWait from test.fork_wait import ForkWait
from test.support import (run_unittest, reap_children, get_attribute, from test.support import (reap_children, get_attribute,
import_module, verbose) import_module, verbose)
threading = import_module('threading') threading = import_module('threading')
@ -104,9 +104,8 @@ class ForkTest(ForkWait):
fork_with_import_lock(level) fork_with_import_lock(level)
def test_main(): def tearDownModule():
run_unittest(ForkTest)
reap_children() reap_children()
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,7 +1,7 @@
"""Tests for Lib/fractions.py.""" """Tests for Lib/fractions.py."""
from decimal import Decimal from decimal import Decimal
from test.support import run_unittest, requires_IEEE_754 from test.support import requires_IEEE_754
import math import math
import numbers import numbers
import operator import operator
@ -606,8 +606,5 @@ class FractionTest(unittest.TestCase):
r = F(13, 7) r = F(13, 7)
self.assertRaises(AttributeError, setattr, r, 'a', 10) self.assertRaises(AttributeError, setattr, r, 'a', 10)
def test_main():
run_unittest(FractionTest, GcdTest)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -161,8 +161,5 @@ class FrameLocalsTest(unittest.TestCase):
self.assertEqual(inner.f_locals, {}) self.assertEqual(inner.f_locals, {})
def test_main():
support.run_unittest(__name__)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,4 +1,3 @@
from test import support
import types import types
import unittest import unittest
@ -374,12 +373,5 @@ class BuiltinFunctionPropertiesTest(unittest.TestCase):
self.assertEqual({'foo': 'bar'}.pop.__qualname__, 'dict.pop') self.assertEqual({'foo': 'bar'}.pop.__qualname__, 'dict.pop')
def test_main():
support.run_unittest(FunctionPropertiesTest, InstancemethodAttrTest,
ArbitraryFunctionAttrTest, FunctionDictsTest,
FunctionDocstringTest, CellTest,
StaticMethodAttrsTest,
BuiltinFunctionPropertiesTest)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1584,32 +1584,5 @@ class TestSingleDispatch(unittest.TestCase):
functools.WeakKeyDictionary = _orig_wkd functools.WeakKeyDictionary = _orig_wkd
def test_main(verbose=None):
test_classes = (
TestPartialC,
TestPartialPy,
TestPartialCSubclass,
TestPartialMethod,
TestUpdateWrapper,
TestTotalOrdering,
TestCmpToKeyC,
TestCmpToKeyPy,
TestWraps,
TestReduce,
TestLRU,
TestSingleDispatch,
)
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)):
support.run_unittest(*test_classes)
gc.collect()
counts[i] = sys.gettotalrefcount()
print(counts)
if __name__ == '__main__': if __name__ == '__main__':
test_main(verbose=True) unittest.main()

View file

@ -1,7 +1,7 @@
# test_getopt.py # test_getopt.py
# David Goodger <dgoodger@bigfoot.com> 2000-08-19 # David Goodger <dgoodger@bigfoot.com> 2000-08-19
from test.support import verbose, run_doctest, run_unittest, EnvironmentVarGuard from test.support import verbose, run_doctest, EnvironmentVarGuard
import unittest import unittest
import getopt import getopt
@ -180,8 +180,5 @@ class GetoptTests(unittest.TestCase):
self.assertEqual(longopts, [('--help', 'x')]) self.assertEqual(longopts, [('--help', 'x')])
self.assertRaises(getopt.GetoptError, getopt.getopt, ['--help='], '', ['help']) self.assertRaises(getopt.GetoptError, getopt.getopt, ['--help='], '', ['help'])
def test_main():
run_unittest(GetoptTests)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,7 +1,7 @@
# Python test set -- part 1, grammar. # Python test set -- part 1, grammar.
# This just tests whether the parser accepts them all. # This just tests whether the parser accepts them all.
from test.support import run_unittest, check_syntax_error from test.support import check_syntax_error
import unittest import unittest
import sys import sys
# testing import * # testing import *
@ -1031,8 +1031,5 @@ class GrammarTests(unittest.TestCase):
self.assertEqual(m.other, 42) self.assertEqual(m.other, 42)
def test_main():
run_unittest(TokenTests, GrammarTests)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -92,8 +92,5 @@ class GroupDatabaseTestCase(unittest.TestCase):
self.assertRaises(KeyError, grp.getgrgid, fakegid) self.assertRaises(KeyError, grp.getgrgid, fakegid)
def test_main():
support.run_unittest(GroupDatabaseTestCase)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -493,14 +493,5 @@ class CompareDigestTestCase(unittest.TestCase):
self.assertFalse(hmac.compare_digest(a, b)) self.assertFalse(hmac.compare_digest(a, b))
def test_main():
support.run_unittest(
TestVectorsTestCase,
ConstructorTestCase,
SanityTestCase,
CopyTestCase,
CompareDigestTestCase
)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -4,7 +4,6 @@ Tests for the html module functions.
import html import html
import unittest import unittest
from test.support import run_unittest
class HtmlTests(unittest.TestCase): class HtmlTests(unittest.TestCase):

View file

@ -451,8 +451,5 @@ class IntTestCases(unittest.TestCase):
check('123\ud800') check('123\ud800')
check('123\ud800', 10) check('123\ud800', 10)
def test_main():
support.run_unittest(IntTestCases)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -4,7 +4,6 @@ This is complex because of changes due to PEP 237.
""" """
import unittest import unittest
from test import support
class TestHexOctBin(unittest.TestCase): class TestHexOctBin(unittest.TestCase):
@ -140,8 +139,5 @@ class TestHexOctBin(unittest.TestCase):
self.assertEqual(-0b1000000000000000000000000000000000000000000000000000000000000000, -9223372036854775808) self.assertEqual(-0b1000000000000000000000000000000000000000000000000000000000000000, -9223372036854775808)
self.assertEqual(-0b1111111111111111111111111111111111111111111111111111111111111111, -18446744073709551615) self.assertEqual(-0b1111111111111111111111111111111111111111111111111111111111111111, -18446744073709551615)
def test_main():
support.run_unittest(TestHexOctBin)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,6 +1,6 @@
import array import array
import unittest import unittest
from test.support import run_unittest, import_module, get_attribute from test.support import import_module, get_attribute
import os, struct import os, struct
fcntl = import_module('fcntl') fcntl = import_module('fcntl')
termios = import_module('termios') termios = import_module('termios')

View file

@ -3,7 +3,6 @@
# testing of error conditions uncovered when using extension types. # testing of error conditions uncovered when using extension types.
import unittest import unittest
from test import support
import sys import sys
@ -277,13 +276,5 @@ def blowstack(fxn, arg, compare_to):
fxn(arg, tuple_arg) fxn(arg, tuple_arg)
def test_main():
support.run_unittest(
TestIsInstanceExceptions,
TestIsSubclassExceptions,
TestIsInstanceIsSubclass
)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -4,7 +4,6 @@ __author__ = "Jiwon Seo"
__email__ = "seojiwon at gmail dot com" __email__ = "seojiwon at gmail dot com"
import unittest import unittest
from test.support import run_unittest
def posonly_sum(pos_arg1, *arg, **kwarg): def posonly_sum(pos_arg1, *arg, **kwarg):
return pos_arg1 + sum(arg) + sum(kwarg.values()) return pos_arg1 + sum(arg) + sum(kwarg.values())
@ -186,8 +185,5 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
self.assertEqual(str(err.exception), "name 'b' is not defined") self.assertEqual(str(err.exception), "name 'b' is not defined")
def test_main():
run_unittest(KeywordOnlyArgTestCase)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -9,7 +9,6 @@ import sys
import time import time
import unittest import unittest
from test import support
if not hasattr(select, "kqueue"): if not hasattr(select, "kqueue"):
raise unittest.SkipTest("test works only on BSD") raise unittest.SkipTest("test works only on BSD")
@ -237,8 +236,5 @@ class TestKQueue(unittest.TestCase):
self.assertEqual(os.get_inheritable(kqueue.fileno()), False) self.assertEqual(os.get_inheritable(kqueue.fileno()), False)
def test_main():
support.run_unittest(TestKQueue)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -108,20 +108,5 @@ class ListTest(list_tests.CommonTest):
with self.assertRaises(TypeError): with self.assertRaises(TypeError):
(3,) + L([1,2]) (3,) + L([1,2])
def test_main(verbose=None):
support.run_unittest(ListTest)
# verify reference counting
import sys
if verbose and hasattr(sys, "gettotalrefcount"):
import gc
counts = [None] * 5
for i in range(len(counts)):
support.run_unittest(ListTest)
gc.collect()
counts[i] = sys.gettotalrefcount()
print(counts)
if __name__ == "__main__": if __name__ == "__main__":
test_main(verbose=True) unittest.main()

View file

@ -1241,8 +1241,5 @@ class LongTest(unittest.TestCase):
self.assertEqual(type(value >> shift), int) self.assertEqual(type(value >> shift), int)
def test_main():
support.run_unittest(LongTest)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,5 +1,4 @@
import unittest import unittest
from test import support
class LongExpText(unittest.TestCase): class LongExpText(unittest.TestCase):
def test_longexp(self): def test_longexp(self):
@ -7,8 +6,5 @@ class LongExpText(unittest.TestCase):
l = eval("[" + "2," * REPS + "]") l = eval("[" + "2," * REPS + "]")
self.assertEqual(len(l), REPS) self.assertEqual(len(l), REPS)
def test_main(): if __name__ == "__main__":
support.run_unittest(LongExpText) unittest.main()
if __name__=="__main__":
test_main()

View file

@ -213,9 +213,5 @@ class FindmatchTest(unittest.TestCase):
self.assertEqual(mailcap.findmatch(*c[0], **c[1]), c[2]) self.assertEqual(mailcap.findmatch(*c[0], **c[1]), c[2])
def test_main():
test.support.run_unittest(HelperFunctionTest, GetcapsTest, FindmatchTest)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -826,10 +826,5 @@ class CStringIOPickleTest(PyStringIOPickleTest):
pass pass
def test_main():
tests = [PyBytesIOTest, PyStringIOTest, CBytesIOTest, CStringIOTest,
PyStringIOPickleTest, CStringIOPickleTest]
support.run_unittest(*tests)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -492,8 +492,5 @@ class ArrayMemorySliceSliceTest(unittest.TestCase,
pass pass
def test_main():
test.support.run_unittest(__name__)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -101,11 +101,5 @@ class Win32MimeTypesTestCase(unittest.TestCase):
eq(self.db.guess_type("image.jpg"), ("image/jpeg", None)) eq(self.db.guess_type("image.jpg"), ("image/jpeg", None))
eq(self.db.guess_type("image.png"), ("image/png", None)) eq(self.db.guess_type("image.png"), ("image/png", None))
def test_main():
support.run_unittest(MimeTypesTestCase,
Win32MimeTypesTestCase
)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,7 +1,7 @@
# test for xml.dom.minidom # test for xml.dom.minidom
import pickle import pickle
from test.support import run_unittest, findfile from test.support import findfile
import unittest import unittest
import xml.dom.minidom import xml.dom.minidom
@ -1545,8 +1545,5 @@ class MinidomTest(unittest.TestCase):
pi = doc.createProcessingInstruction("y", "z") pi = doc.createProcessingInstruction("y", "z")
pi.nodeValue = "crash" pi.nodeValue = "crash"
def test_main():
run_unittest(MinidomTest)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,7 +1,7 @@
# Test the module type # Test the module type
import unittest import unittest
import weakref import weakref
from test.support import run_unittest, gc_collect from test.support import gc_collect
from test.script_helper import assert_python_ok from test.script_helper import assert_python_ok
import sys import sys
@ -238,9 +238,5 @@ a = A(destroyed)"""
# frozen and namespace module reprs are tested in importlib. # frozen and namespace module reprs are tested in importlib.
def test_main():
run_unittest(ModuleTests)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -1,7 +1,7 @@
""" Test suite for the code in msilib """ """ Test suite for the code in msilib """
import unittest import unittest
import os import os
from test.support import run_unittest, import_module from test.support import import_module
msilib = import_module('msilib') msilib = import_module('msilib')
class Test_make_id(unittest.TestCase): class Test_make_id(unittest.TestCase):
@ -39,8 +39,5 @@ class Test_make_id(unittest.TestCase):
msilib.make_id(".s\x82o?*+rt"), "_.s_o___rt") msilib.make_id(".s\x82o?*+rt"), "_.s_o___rt")
def test_main():
run_unittest(__name__)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -36,8 +36,5 @@ class NisTests(unittest.TestCase):
if done: if done:
break break
def test_main():
support.run_unittest(NisTests)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -1,4 +1,4 @@
from test.support import run_unittest, open_urlresource from test.support import open_urlresource
import unittest import unittest
from http.client import HTTPException from http.client import HTTPException
@ -97,8 +97,5 @@ class NormalizationTest(unittest.TestCase):
normalize('NFC', '\ud55c\uae00') normalize('NFC', '\ud55c\uae00')
def test_main():
run_unittest(NormalizationTest)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -5,7 +5,6 @@ import random
import math import math
import sys import sys
import operator import operator
from test.support import run_unittest
from decimal import Decimal as D from decimal import Decimal as D
from fractions import Fraction as F from fractions import Fraction as F
@ -199,8 +198,5 @@ class ComparisonTest(unittest.TestCase):
self.assertRaises(TypeError, op, v, z) self.assertRaises(TypeError, op, v, z)
def test_main():
run_unittest(HashTest, ComparisonTest)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -1,6 +1,5 @@
# Python test set -- part 2, opcodes # Python test set -- part 2, opcodes
from test.support import run_unittest
import unittest import unittest
class OpcodeTest(unittest.TestCase): class OpcodeTest(unittest.TestCase):
@ -105,8 +104,5 @@ class OpcodeTest(unittest.TestCase):
self.assertEqual(MyString() % 3, 42) self.assertEqual(MyString() % 3, 42)
def test_main():
run_unittest(OpcodeTest)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -1,7 +1,6 @@
# Test to see if openpty works. (But don't worry if it isn't available.) # Test to see if openpty works. (But don't worry if it isn't available.)
import os, unittest import os, unittest
from test.support import run_unittest
if not hasattr(os, "openpty"): if not hasattr(os, "openpty"):
raise unittest.SkipTest("os.openpty() not available.") raise unittest.SkipTest("os.openpty() not available.")
@ -18,8 +17,5 @@ class OpenptyTest(unittest.TestCase):
os.write(slave, b'Ping!') os.write(slave, b'Ping!')
self.assertEqual(os.read(master, 1024), b'Ping!') self.assertEqual(os.read(master, 1024), b'Ping!')
def test_main():
run_unittest(OpenptyTest)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -2,7 +2,7 @@
Test suite for OS X interpreter environment variables. Test suite for OS X interpreter environment variables.
""" """
from test.support import EnvironmentVarGuard, run_unittest from test.support import EnvironmentVarGuard
import subprocess import subprocess
import sys import sys
import sysconfig import sysconfig

View file

@ -730,16 +730,5 @@ class OtherParserCase(unittest.TestCase):
with self.assertRaises(TypeError): with self.assertRaises(TypeError):
parser.expr("a", "b") parser.expr("a", "b")
def test_main():
support.run_unittest(
RoundtripLegalSyntaxTestCase,
IllegalSyntaxTestCase,
CompileTestCase,
ParserStackLimitTestCase,
STObjectTestCase,
OtherParserCase,
)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -319,21 +319,5 @@ class TestBuglets(unittest.TestCase):
f() f()
def test_main(verbose=None):
import sys
from test import support
test_classes = (TestTranforms, TestBuglets)
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)):
support.run_unittest(*test_classes)
gc.collect()
counts[i] = sys.gettotalrefcount()
print(counts)
if __name__ == "__main__": if __name__ == "__main__":
test_main(verbose=True) unittest.main()

View file

@ -6,7 +6,6 @@ for hashing algorithms
import hmac import hmac
import unittest import unittest
from hashlib import md5, sha1, sha224, sha256, sha384, sha512 from hashlib import md5, sha1, sha224, sha256, sha384, sha512
from test import support
class Pep247Test(unittest.TestCase): class Pep247Test(unittest.TestCase):
@ -63,8 +62,5 @@ class Pep247Test(unittest.TestCase):
def test_hmac(self): def test_hmac(self):
self.check_module(hmac, key=b'abc') self.check_module(hmac, key=b'abc')
def test_main():
support.run_unittest(Pep247Test)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -244,11 +244,5 @@ class TestTemplate(unittest.TestCase):
'tim likes to eat a bag of ham worth $100') 'tim likes to eat a bag of ham worth $100')
def test_main():
from test import support
test_classes = [TestTemplate,]
support.run_unittest(*test_classes)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -1,7 +1,6 @@
# This file is marked as binary in the CVS, to prevent MacCVS from recoding it. # This file is marked as binary in the CVS, to prevent MacCVS from recoding it.
import unittest import unittest
from test import support
class PEP3120Test(unittest.TestCase): class PEP3120Test(unittest.TestCase):
@ -40,8 +39,5 @@ class BuiltinCompileTests(unittest.TestCase):
self.assertEqual('Ç', ns['u']) self.assertEqual('Ç', ns['u'])
def test_main(): if __name__ == "__main__":
support.run_unittest(PEP3120Test, BuiltinCompileTests) unittest.main()
if __name__=="__main__":
test_main()

View file

@ -1,6 +1,5 @@
import unittest import unittest
import sys import sys
from test import support
class PEP3131Test(unittest.TestCase): class PEP3131Test(unittest.TestCase):
@ -28,8 +27,5 @@ class PEP3131Test(unittest.TestCase):
else: else:
self.fail("expected exception didn't occur") self.fail("expected exception didn't occur")
def test_main(): if __name__ == "__main__":
support.run_unittest(PEP3131Test) unittest.main()
if __name__=="__main__":
test_main()

View file

@ -7,7 +7,6 @@ import unittest
import errno import errno
from errno import EEXIST from errno import EEXIST
from test import support
class SubOSError(OSError): class SubOSError(OSError):
pass pass
@ -202,8 +201,5 @@ class ExplicitSubclassingTest(unittest.TestCase):
self.assertEqual(str(e), '') self.assertEqual(str(e), '')
def test_main(): if __name__ == "__main__":
support.run_unittest(__name__) unittest.main()
if __name__=="__main__":
test_main()

View file

@ -1013,11 +1013,5 @@ class TestPEP380Operation(unittest.TestCase):
self.assertEqual(v, (1, 2, 3, 4)) self.assertEqual(v, (1, 2, 3, 4))
def test_main():
from test import support
test_classes = [TestPEP380Operation]
support.run_unittest(*test_classes)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -291,9 +291,5 @@ class TestPkg(unittest.TestCase):
import t8 import t8
self.assertEqual(t8.__doc__, "doc for t8") self.assertEqual(t8.__doc__, "doc for t8")
def test_main():
support.run_unittest(__name__)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -7,7 +7,7 @@ import tempfile
import unittest import unittest
from importlib.util import cache_from_source from importlib.util import cache_from_source
from test.support import run_unittest, create_empty_file from test.support import create_empty_file
class TestImport(unittest.TestCase): class TestImport(unittest.TestCase):
@ -76,9 +76,5 @@ class TestImport(unittest.TestCase):
self.assertEqual(getattr(module, var), 1) self.assertEqual(getattr(module, var), 1)
def test_main():
run_unittest(TestImport)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -57,8 +57,5 @@ class PopenTest(unittest.TestCase):
with os.popen("echo hello") as f: with os.popen("echo hello") as f:
self.assertEqual(list(f), ["hello\n"]) self.assertEqual(list(f), ["hello\n"])
def test_main():
support.run_unittest(PopenTest)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -122,8 +122,5 @@ class PowTest(unittest.TestCase):
eq(pow(a, -fiveto), expected) eq(pow(a, -fiveto), expected)
eq(expected, 1.0) # else we didn't push fiveto to evenness eq(expected, 1.0) # else we didn't push fiveto to evenness
def test_main():
test.support.run_unittest(PowTest)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -3,7 +3,6 @@
import sys import sys
import unittest import unittest
from test.support import run_unittest
class PropertyBase(Exception): class PropertyBase(Exception):
pass pass
@ -247,8 +246,5 @@ class PropertySubclassTests(unittest.TestCase):
def test_main():
run_unittest(PropertyTests, PropertySubclassTests)
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View file

@ -34,12 +34,5 @@ class StatsTestCase(unittest.TestCase):
stats.add(self.stats, self.stats) stats.add(self.stats, self.stats)
def test_main():
support.run_unittest(
AddCallersTestCase,
StatsTestCase,
)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,4 +1,4 @@
from test.support import verbose, run_unittest, import_module, reap_children from test.support import verbose, import_module, reap_children
# Skip these tests if termios is not available # Skip these tests if termios is not available
import_module('termios') import_module('termios')
@ -293,11 +293,8 @@ class SmallPtyTests(unittest.TestCase):
pty._copy(masters[0]) pty._copy(masters[0])
def test_main(verbose=None): def tearDownModule():
try: reap_children()
run_unittest(SmallPtyTests, PtyTest)
finally:
reap_children()
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -6,7 +6,7 @@ import xml.sax
from xml.sax.xmlreader import AttributesImpl from xml.sax.xmlreader import AttributesImpl
from xml.dom import pulldom from xml.dom import pulldom
from test.support import run_unittest, findfile from test.support import findfile
tstfile = findfile("test.xml", subdir="xmltestdata") tstfile = findfile("test.xml", subdir="xmltestdata")
@ -339,9 +339,5 @@ class SAX2DOMTestCase(unittest.TestCase):
doc.unlink() doc.unlink()
def test_main():
run_unittest(PullDOMTestCase, ThoroughTestCase, SAX2DOMTestCase)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -107,8 +107,5 @@ class PwdTest(unittest.TestCase):
self.assertRaises(KeyError, pwd.getpwuid, 2**128) self.assertRaises(KeyError, pwd.getpwuid, 2**128)
self.assertRaises(KeyError, pwd.getpwuid, -2**128) self.assertRaises(KeyError, pwd.getpwuid, -2**128)
def test_main():
support.run_unittest(PwdTest)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -2,7 +2,6 @@
Test cases for pyclbr.py Test cases for pyclbr.py
Nick Mathewson Nick Mathewson
''' '''
from test.support import run_unittest
import sys import sys
from types import FunctionType, MethodType, BuiltinFunctionType from types import FunctionType, MethodType, BuiltinFunctionType
import pyclbr import pyclbr
@ -173,9 +172,5 @@ class PyclbrTest(TestCase):
self.assertRaises(ImportError, pyclbr.readmodule_ex, 'asyncore.foo') self.assertRaises(ImportError, pyclbr.readmodule_ex, 'asyncore.foo')
def test_main():
run_unittest(PyclbrTest)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -10,7 +10,7 @@ import traceback
from xml.parsers import expat from xml.parsers import expat
from xml.parsers.expat import errors from xml.parsers.expat import errors
from test.support import sortdict, run_unittest from test.support import sortdict
class SetAttributeTest(unittest.TestCase): class SetAttributeTest(unittest.TestCase):
@ -708,19 +708,5 @@ class ForeignDTDTests(unittest.TestCase):
self.assertEqual(handler_call_args, [("bar", "baz")]) self.assertEqual(handler_call_args, [("bar", "baz")])
def test_main():
run_unittest(SetAttributeTest,
ParseTest,
NamespaceSeparatorTest,
InterningTest,
BufferTextTest,
HandlerExceptionTest,
PositionTest,
sf1296433Test,
ChardataBufferTest,
MalformedInputTest,
ErrorMessageTest,
ForeignDTDTests)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -354,10 +354,5 @@ class FailingQueueTest(BlockingTestMixin, unittest.TestCase):
self.failing_queue_test(q) self.failing_queue_test(q)
def test_main():
support.run_unittest(QueueTest, LifoQueueTest, PriorityQueueTest,
FailingQueueTest)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

View file

@ -1,4 +1,3 @@
from test import support
import unittest import unittest
import sys, os, io, subprocess import sys, os, io, subprocess
@ -207,9 +206,5 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
p = p.decode('latin-1') p = p.decode('latin-1')
self.assertEqual(cout.splitlines(), p.splitlines()) self.assertEqual(cout.splitlines(), p.splitlines())
def test_main():
support.run_unittest(QuopriTestCase)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()

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