Index: Lib/test/test_StringIO.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_StringIO.py,v retrieving revision 1.15 diff -u -r1.15 test_StringIO.py --- Lib/test/test_StringIO.py 24 Apr 2003 15:50:10 -0000 1.15 +++ Lib/test/test_StringIO.py 1 May 2003 16:41:56 -0000 @@ -105,10 +105,12 @@ def test_main(): - test_support.run_unittest(TestStringIO) - test_support.run_unittest(TestcStringIO) - test_support.run_unittest(TestBufferStringIO) - test_support.run_unittest(TestBuffercStringIO) + test_support.run_unittest( + TestStringIO, + TestcStringIO, + TestBufferStringIO, + TestBuffercStringIO + ) if __name__ == '__main__': test_main() Index: Lib/test/test___all__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test___all__.py,v retrieving revision 1.29 diff -u -r1.29 test___all__.py --- Lib/test/test___all__.py 15 Apr 2003 11:10:33 -0000 1.29 +++ Lib/test/test___all__.py 1 May 2003 16:41:56 -0000 @@ -192,9 +192,7 @@ def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(AllTest)) - test_support.run_suite(suite) + test_support.run_unittest(AllTest) if __name__ == "__main__": test_main() Index: Lib/test/test_base64.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_base64.py,v retrieving revision 1.5 diff -u -r1.5 test_base64.py --- Lib/test/test_base64.py 22 Aug 2002 19:18:56 -0000 1.5 +++ Lib/test/test_base64.py 1 May 2003 16:41:56 -0000 @@ -1,16 +1,16 @@ -from unittest import TestCase -from test.test_support import vereq, run_unittest -from base64 import encodestring, decodestring +import unittest +from test import test_support +import base64 -class Base64TestCase(TestCase): +class Base64TestCase(unittest.TestCase): def test_encodestring(self): - vereq(encodestring("www.python.org"), "d3d3LnB5dGhvbi5vcmc=\n") - vereq(encodestring("a"), "YQ==\n") - vereq(encodestring("ab"), "YWI=\n") - vereq(encodestring("abc"), "YWJj\n") - vereq(encodestring(""), "") - vereq(encodestring("abcdefghijklmnopqrstuvwxyz" + self.assertEqual(base64.encodestring("www.python.org"), "d3d3LnB5dGhvbi5vcmc=\n") + self.assertEqual(base64.encodestring("a"), "YQ==\n") + self.assertEqual(base64.encodestring("ab"), "YWI=\n") + self.assertEqual(base64.encodestring("abc"), "YWJj\n") + self.assertEqual(base64.encodestring(""), "") + self.assertEqual(base64.encodestring("abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789!@#0^&*();:<>,. []{}"), "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE" @@ -18,20 +18,20 @@ "Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n") def test_decodestring(self): - vereq(decodestring("d3d3LnB5dGhvbi5vcmc=\n"), "www.python.org") - vereq(decodestring("YQ==\n"), "a") - vereq(decodestring("YWI=\n"), "ab") - vereq(decodestring("YWJj\n"), "abc") - vereq(decodestring("YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE" + self.assertEqual(base64.decodestring("d3d3LnB5dGhvbi5vcmc=\n"), "www.python.org") + self.assertEqual(base64.decodestring("YQ==\n"), "a") + self.assertEqual(base64.decodestring("YWI=\n"), "ab") + self.assertEqual(base64.decodestring("YWJj\n"), "abc") + self.assertEqual(base64.decodestring("YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE" "RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT" "Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n"), "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789!@#0^&*();:<>,. []{}") - vereq(decodestring(''), '') + self.assertEqual(base64.decodestring(''), '') def test_main(): - run_unittest(Base64TestCase) + test_support.run_unittest(Base64TestCase) if __name__ == "__main__": test_main() Index: Lib/test/test_bisect.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_bisect.py,v retrieving revision 1.8 diff -u -r1.8 test_bisect.py --- Lib/test/test_bisect.py 27 Apr 2003 07:54:23 -0000 1.8 +++ Lib/test/test_bisect.py 1 May 2003 16:41:57 -0000 @@ -198,8 +198,7 @@ def test_main(verbose=None): from test import test_bisect - test_support.run_classtests(TestBisect, - TestInsort) + test_support.run_unittest(TestBisect, TestInsort) test_support.run_doctest(test_bisect, verbose) if __name__ == "__main__": Index: Lib/test/test_bool.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_bool.py,v retrieving revision 1.11 diff -u -r1.11 test_bool.py --- Lib/test/test_bool.py 1 May 2003 13:12:34 -0000 1.11 +++ Lib/test/test_bool.py 1 May 2003 16:41:57 -0000 @@ -321,7 +321,7 @@ self.assertEqual(cPickle.dumps(False, True), "I00\n.") def test_main(): - test_support.run_classtests(BoolTest) + test_support.run_unittest(BoolTest) if __name__ == "__main__": test_main() Index: Lib/test/test_builtin.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_builtin.py,v retrieving revision 1.18 diff -u -r1.18 test_builtin.py --- Lib/test/test_builtin.py 22 Apr 2003 08:12:30 -0000 1.18 +++ Lib/test/test_builtin.py 1 May 2003 16:41:58 -0000 @@ -1219,9 +1219,7 @@ self.assertRaises(ValueError, zip, BadSeq(), BadSeq()) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(BuiltinTest)) - test.test_support.run_suite(suite) + test.test_support.run_unittest(BuiltinTest) if __name__ == "__main__": test_main() Index: Lib/test/test_bz2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_bz2.py,v retrieving revision 1.13 diff -u -r1.13 test_bz2.py --- Lib/test/test_bz2.py 29 Apr 2003 14:53:08 -0000 1.13 +++ Lib/test/test_bz2.py 1 May 2003 16:41:59 -0000 @@ -309,13 +309,12 @@ self.assertRaises(ValueError, bz2.decompress, self.DATA[:-10]) def test_main(): - suite = unittest.TestSuite() - for test in (BZ2FileTest, - BZ2CompressorTest, - BZ2DecompressorTest, - FuncTest): - suite.addTest(unittest.makeSuite(test)) - test_support.run_suite(suite) + test_support.run_unittest( + BZ2FileTest, + BZ2CompressorTest, + BZ2DecompressorTest, + FuncTest + ) if __name__ == '__main__': test_main() Index: Lib/test/test_calendar.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_calendar.py,v retrieving revision 1.4 diff -u -r1.4 test_calendar.py --- Lib/test/test_calendar.py 23 Jul 2002 19:03:45 -0000 1.4 +++ Lib/test/test_calendar.py 1 May 2003 16:41:59 -0000 @@ -1,7 +1,7 @@ import calendar import unittest -from test.test_support import run_unittest +from test import test_support class CalendarTestCase(unittest.TestCase): @@ -55,7 +55,7 @@ self.assertEqual(len(d), 13) def test_main(): - run_unittest(CalendarTestCase) + test_support.run_unittest(CalendarTestCase) if __name__ == "__main__": test_main() Index: Lib/test/test_call.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_call.py,v retrieving revision 1.3 diff -u -r1.3 test_call.py --- Lib/test/test_call.py 23 Jul 2002 19:03:45 -0000 1.3 +++ Lib/test/test_call.py 1 May 2003 16:41:59 -0000 @@ -1,5 +1,5 @@ import unittest -from test.test_support import run_unittest +from test import test_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 @@ def test_main(): - run_unittest(CFunctionCalls) + test_support.run_unittest(CFunctionCalls) if __name__ == "__main__": Index: Lib/test/test_cfgparser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_cfgparser.py,v retrieving revision 1.19 diff -u -r1.19 test_cfgparser.py --- Lib/test/test_cfgparser.py 31 Dec 2002 06:57:25 -0000 1.19 +++ Lib/test/test_cfgparser.py 1 May 2003 16:41:59 -0000 @@ -322,11 +322,11 @@ def test_main(): - suite = unittest.TestSuite() - suite.addTests([unittest.makeSuite(ConfigParserTestCase), - unittest.makeSuite(RawConfigParserTestCase), - unittest.makeSuite(SafeConfigParserTestCase)]) - test_support.run_suite(suite) + test_support.run_unittest( + ConfigParserTestCase, + RawConfigParserTestCase, + SafeConfigParserTestCase + ) if __name__ == "__main__": test_main() Index: Lib/test/test_charmapcodec.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_charmapcodec.py,v retrieving revision 1.6 diff -u -r1.6 test_charmapcodec.py --- Lib/test/test_charmapcodec.py 14 Feb 2003 11:21:53 -0000 1.6 +++ Lib/test/test_charmapcodec.py 1 May 2003 16:42:00 -0000 @@ -39,9 +39,7 @@ self.assertRaises(UnicodeError, unicode, 'abc\001', codecname) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(CharmapCodecTest)) - test.test_support.run_suite(suite) + test.test_support.run_unittest(CharmapCodecTest) if __name__ == "__main__": test_main() Index: Lib/test/test_codeccallbacks.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codeccallbacks.py,v retrieving revision 1.11 diff -u -r1.11 test_codeccallbacks.py --- Lib/test/test_codeccallbacks.py 29 Apr 2003 20:59:55 -0000 1.11 +++ Lib/test/test_codeccallbacks.py 1 May 2003 16:42:00 -0000 @@ -659,9 +659,7 @@ self.assertRaises(TypeError, u"\xff".translate, {0xff: ()}) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(CodecCallbackTest)) - test.test_support.run_suite(suite) + test.test_support.run_unittest(CodecCallbackTest) if __name__ == "__main__": test_main() Index: Lib/test/test_codecs.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codecs.py,v retrieving revision 1.8 diff -u -r1.8 test_codecs.py --- Lib/test/test_codecs.py 24 Apr 2003 16:02:51 -0000 1.8 +++ Lib/test/test_codecs.py 1 May 2003 16:42:01 -0000 @@ -333,13 +333,13 @@ raise test_support.TestFailed("Test 3.%d: %s" % (pos+1, str(e))) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(UTF16Test)) - suite.addTest(unittest.makeSuite(EscapeDecodeTest)) - suite.addTest(unittest.makeSuite(RecodingTest)) - suite.addTest(unittest.makeSuite(PunycodeTest)) - suite.addTest(unittest.makeSuite(NameprepTest)) - test_support.run_suite(suite) + test_support.run_unittest( + UTF16Test, + EscapeDecodeTest, + RecodingTest, + PunycodeTest, + NameprepTest + ) if __name__ == "__main__": Index: Lib/test/test_copy.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_copy.py,v retrieving revision 1.7 diff -u -r1.7 test_copy.py --- Lib/test/test_copy.py 19 Feb 2003 01:19:28 -0000 1.7 +++ Lib/test/test_copy.py 1 May 2003 16:42:01 -0000 @@ -516,9 +516,7 @@ self.assert_(x[0] is not y[0]) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(TestCopy)) - test_support.run_suite(suite) + test_support.run_unittest(TestCopy) if __name__ == "__main__": test_main() Index: Lib/test/test_cpickle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_cpickle.py,v retrieving revision 1.14 diff -u -r1.14 test_cpickle.py --- Lib/test/test_cpickle.py 21 Feb 2003 20:14:35 -0000 1.14 +++ Lib/test/test_cpickle.py 1 May 2003 16:42:01 -0000 @@ -92,13 +92,12 @@ self.assertEqual(a, b) def test_main(): - loader = unittest.TestLoader() - suite = unittest.TestSuite() - suite.addTest(loader.loadTestsFromTestCase(cPickleTests)) - suite.addTest(loader.loadTestsFromTestCase(cPicklePicklerTests)) - suite.addTest(loader.loadTestsFromTestCase(cPickleListPicklerTests)) - suite.addTest(loader.loadTestsFromTestCase(cPickleFastPicklerTests)) - test_support.run_suite(suite) + test_support.run_unittest( + cPickleTests, + cPicklePicklerTests, + cPickleListPicklerTests, + cPickleFastPicklerTests + ) if __name__ == "__main__": test_main() Index: Lib/test/test_csv.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_csv.py,v retrieving revision 1.5 diff -u -r1.5 test_csv.py --- Lib/test/test_csv.py 25 Apr 2003 14:43:14 -0000 1.5 +++ Lib/test/test_csv.py 1 May 2003 16:42:02 -0000 @@ -6,7 +6,7 @@ from StringIO import StringIO import csv import gc -from test.test_support import verbose +from test import test_support class Test_Csv(unittest.TestCase): """ @@ -568,7 +568,7 @@ self.assertEqual(dialect.skipinitialspace, False) if not hasattr(sys, "gettotalrefcount"): - if verbose: print "*** skipping leakage tests ***" + if test_support.verbose: print "*** skipping leakage tests ***" else: class NUL: def write(s, *args): @@ -640,15 +640,11 @@ # if writer leaks during write, last delta should be 5 or more self.assertEqual(delta < 5, True) -def _testclasses(): +def test_main(): mod = sys.modules[__name__] - return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')] - -def suite(): - suite = unittest.TestSuite() - for testclass in _testclasses(): - suite.addTest(unittest.makeSuite(testclass)) - return suite + test_support.run_unittest( + *[getattr(mod, name) for name in dir(mod) if name.startswith('Test')] + ) if __name__ == '__main__': - unittest.main(defaultTest='suite') + test_main() Index: Lib/test/test_dummy_thread.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_dummy_thread.py,v retrieving revision 1.3 diff -u -r1.3 test_dummy_thread.py --- Lib/test/test_dummy_thread.py 30 Apr 2003 03:03:37 -0000 1.3 +++ Lib/test/test_dummy_thread.py 1 May 2003 16:42:05 -0000 @@ -162,11 +162,7 @@ if test_support.verbose: print print "*** Using %s as _thread module ***" % _thread - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(LockTests)) - suite.addTest(unittest.makeSuite(MiscTests)) - suite.addTest(unittest.makeSuite(ThreadTests)) - test_support.run_suite(suite) + test_support.run_unittest(LockTests, MiscTests, ThreadTests) if __name__ == '__main__': test_main() Index: Lib/test/test_enumerate.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_enumerate.py,v retrieving revision 1.3 diff -u -r1.3 test_enumerate.py --- Lib/test/test_enumerate.py 23 Jul 2002 19:03:50 -0000 1.3 +++ Lib/test/test_enumerate.py 1 May 2003 16:42:05 -0000 @@ -104,14 +104,8 @@ enum = MyEnum -def suite(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(EnumerateTestCase)) - suite.addTest(unittest.makeSuite(SubclassTestCase)) - return suite - def test_main(): - test_support.run_suite(suite()) + test_support.run_unittest(EnumerateTestCase, SubclassTestCase) if __name__ == "__main__": test_main() Index: Lib/test/test_filecmp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_filecmp.py,v retrieving revision 1.1 diff -u -r1.1 test_filecmp.py --- Lib/test/test_filecmp.py 6 Feb 2003 17:42:45 -0000 1.1 +++ Lib/test/test_filecmp.py 1 May 2003 16:42:05 -0000 @@ -119,10 +119,7 @@ def test_main(): - suite = unittest.TestSuite() - for cls in FileCompareTestCase, DirCompareTestCase: - suite.addTest(unittest.makeSuite(cls)) - test_support.run_suite(suite) + test_support.run_unittest(FileCompareTestCase, DirCompareTestCase) if __name__ == "__main__": test_main() Index: Lib/test/test_getargs2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_getargs2.py,v retrieving revision 1.4 diff -u -r1.4 test_getargs2.py --- Lib/test/test_getargs2.py 24 Apr 2003 16:15:29 -0000 1.4 +++ Lib/test/test_getargs2.py 1 May 2003 16:42:07 -0000 @@ -223,16 +223,14 @@ self.failUnlessEqual(VERY_LARGE & ULLONG_MAX, getargs_K(VERY_LARGE)) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(Signed_TestCase)) - suite.addTest(unittest.makeSuite(Unsigned_TestCase)) + tests = [Signed_TestCase, Unsigned_TestCase] try: from _testcapi import getargs_L, getargs_K except ImportError: pass # PY_LONG_LONG not available else: - suite.addTest(unittest.makeSuite(LongLong_TestCase)) - test_support.run_suite(suite) + tests.append(LongLong_TestCase) + test_support.run_unittest(*tests) if __name__ == "__main__": test_main() Index: Lib/test/test_grp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_grp.py,v retrieving revision 1.15 diff -u -r1.15 test_grp.py --- Lib/test/test_grp.py 23 Apr 2003 19:50:24 -0000 1.15 +++ Lib/test/test_grp.py 1 May 2003 16:42:10 -0000 @@ -97,9 +97,7 @@ self.assertRaises(KeyError, grp.getgrgid, fakegid) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(GroupDatabaseTestCase)) - test_support.run_suite(suite) + test_support.run_unittest(GroupDatabaseTestCase) if __name__ == "__main__": test_main() Index: Lib/test/test_hexoct.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_hexoct.py,v retrieving revision 1.3 diff -u -r1.3 test_hexoct.py --- Lib/test/test_hexoct.py 18 Feb 2003 15:45:44 -0000 1.3 +++ Lib/test/test_hexoct.py 1 May 2003 16:42:11 -0000 @@ -118,9 +118,7 @@ \n""" def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(TextHexOct)) - test_support.run_suite(suite) + test_support.run_unittest(TextHexOct) if __name__ == "__main__": test_main() Index: Lib/test/test_hmac.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_hmac.py,v retrieving revision 1.6 diff -u -r1.6 test_hmac.py --- Lib/test/test_hmac.py 22 Aug 2002 19:38:14 -0000 1.6 +++ Lib/test/test_hmac.py 1 May 2003 16:42:11 -0000 @@ -103,12 +103,12 @@ "Hexdigest of copy doesn't match original hexdigest.") def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(TestVectorsTestCase)) - suite.addTest(unittest.makeSuite(ConstructorTestCase)) - suite.addTest(unittest.makeSuite(SanityTestCase)) - suite.addTest(unittest.makeSuite(CopyTestCase)) - test_support.run_suite(suite) + test_support.run_unittest( + TestVectorsTestCase, + ConstructorTestCase, + SanityTestCase, + CopyTestCase + ) if __name__ == "__main__": test_main() Index: Lib/test/test_isinstance.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_isinstance.py,v retrieving revision 1.6 diff -u -r1.6 test_isinstance.py --- Lib/test/test_isinstance.py 12 Dec 2002 19:14:07 -0000 1.6 +++ Lib/test/test_isinstance.py 1 May 2003 16:42:14 -0000 @@ -248,11 +248,11 @@ def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(TestIsInstanceExceptions)) - suite.addTest(unittest.makeSuite(TestIsSubclassExceptions)) - suite.addTest(unittest.makeSuite(TestIsInstanceIsSubclass)) - test_support.run_suite(suite) + test_support.run_unittest( + TestIsInstanceExceptions, + TestIsSubclassExceptions, + TestIsInstanceIsSubclass + ) if __name__ == '__main__': Index: Lib/test/test_itertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v retrieving revision 1.5 diff -u -r1.5 test_itertools.py --- Lib/test/test_itertools.py 23 Feb 2003 04:40:07 -0000 1.5 +++ Lib/test/test_itertools.py 1 May 2003 16:42:16 -0000 @@ -162,9 +162,7 @@ def test_main(verbose=None): import test_itertools suite = unittest.TestSuite() - for testclass in (TestBasicOps, - ): - suite.addTest(unittest.makeSuite(testclass)) + suite.addTest(unittest.makeSuite(TestBasicOps)) test_support.run_suite(suite) test_support.run_doctest(test_itertools, verbose) Index: Lib/test/test_optparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_optparse.py,v retrieving revision 1.1 diff -u -r1.1 test_optparse.py --- Lib/test/test_optparse.py 21 Apr 2003 02:41:25 -0000 1.1 +++ Lib/test/test_optparse.py 1 May 2003 16:42:26 -0000 @@ -1193,18 +1193,11 @@ "ambiguous option: --f (%s?)" % possibilities, funcargs=[s, wordmap]) -def _testclasses(): - mod = sys.modules[__name__] - return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')] - -def suite(): - suite = unittest.TestSuite() - for testclass in _testclasses(): - suite.addTest(unittest.makeSuite(testclass)) - return suite - def test_main(): - test_support.run_suite(suite()) + mod = sys.modules[__name__] + test_support.run_unittest( + *[getattr(mod, name) for name in dir(mod) if name.startswith('Test')] + ) if __name__ == '__main__': unittest.main() Index: Lib/test/test_os.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_os.py,v retrieving revision 1.17 diff -u -r1.17 test_os.py --- Lib/test/test_os.py 28 Apr 2003 03:13:03 -0000 1.17 +++ Lib/test/test_os.py 1 May 2003 16:42:27 -0000 @@ -5,21 +5,20 @@ import os import unittest import warnings +from test import test_support warnings.filterwarnings("ignore", "tempnam", RuntimeWarning, __name__) warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning, __name__) -from test.test_support import TESTFN, run_classtests - class TemporaryFileTests(unittest.TestCase): def setUp(self): self.files = [] - os.mkdir(TESTFN) + os.mkdir(test_support.TESTFN) def tearDown(self): for name in self.files: os.unlink(name) - os.rmdir(TESTFN) + os.rmdir(test_support.TESTFN) def check_tempfile(self, name): # make sure it doesn't already exist: @@ -36,10 +35,10 @@ r"test_os$") self.check_tempfile(os.tempnam()) - name = os.tempnam(TESTFN) + name = os.tempnam(test_support.TESTFN) self.check_tempfile(name) - name = os.tempnam(TESTFN, "pfx") + name = os.tempnam(test_support.TESTFN, "pfx") self.assert_(os.path.basename(name)[:3] == "pfx") self.check_tempfile(name) @@ -84,15 +83,15 @@ # Test attributes on return values from os.*stat* family. class StatAttributeTests(unittest.TestCase): def setUp(self): - os.mkdir(TESTFN) - self.fname = os.path.join(TESTFN, "f1") + os.mkdir(test_support.TESTFN) + self.fname = os.path.join(test_support.TESTFN, "f1") f = open(self.fname, 'wb') f.write("ABC") f.close() def tearDown(self): os.unlink(self.fname) - os.rmdir(TESTFN) + os.rmdir(test_support.TESTFN) def test_stat_attributes(self): if not hasattr(os, "stat"): @@ -238,10 +237,10 @@ # SUB11/ no kids # SUB2/ just a file kid # tmp3 - sub1_path = join(TESTFN, "SUB1") + sub1_path = join(test_support.TESTFN, "SUB1") sub11_path = join(sub1_path, "SUB11") - sub2_path = join(TESTFN, "SUB2") - tmp1_path = join(TESTFN, "tmp1") + sub2_path = join(test_support.TESTFN, "SUB2") + tmp1_path = join(test_support.TESTFN, "tmp1") tmp2_path = join(sub1_path, "tmp2") tmp3_path = join(sub2_path, "tmp3") @@ -254,39 +253,39 @@ f.close() # Walk top-down. - all = list(os.walk(TESTFN)) + all = list(os.walk(test_support.TESTFN)) self.assertEqual(len(all), 4) # We can't know which order SUB1 and SUB2 will appear in. # Not flipped: TESTFN, SUB1, SUB11, SUB2 # flipped: TESTFN, SUB2, SUB1, SUB11 flipped = all[0][1][0] != "SUB1" all[0][1].sort() - self.assertEqual(all[0], (TESTFN, ["SUB1", "SUB2"], ["tmp1"])) + self.assertEqual(all[0], (test_support.TESTFN, ["SUB1", "SUB2"], ["tmp1"])) self.assertEqual(all[1 + flipped], (sub1_path, ["SUB11"], ["tmp2"])) self.assertEqual(all[2 + flipped], (sub11_path, [], [])) self.assertEqual(all[3 - 2 * flipped], (sub2_path, [], ["tmp3"])) # Prune the search. all = [] - for root, dirs, files in os.walk(TESTFN): + for root, dirs, files in os.walk(test_support.TESTFN): all.append((root, dirs, files)) # Don't descend into SUB1. if 'SUB1' in dirs: # Note that this also mutates the dirs we appended to all! dirs.remove('SUB1') self.assertEqual(len(all), 2) - self.assertEqual(all[0], (TESTFN, ["SUB2"], ["tmp1"])) + self.assertEqual(all[0], (test_support.TESTFN, ["SUB2"], ["tmp1"])) self.assertEqual(all[1], (sub2_path, [], ["tmp3"])) # Walk bottom-up. - all = list(os.walk(TESTFN, topdown=False)) + all = list(os.walk(test_support.TESTFN, topdown=False)) self.assertEqual(len(all), 4) # We can't know which order SUB1 and SUB2 will appear in. # Not flipped: SUB11, SUB1, SUB2, TESTFN # flipped: SUB2, SUB11, SUB1, TESTFN flipped = all[3][1][0] != "SUB1" all[3][1].sort() - self.assertEqual(all[3], (TESTFN, ["SUB1", "SUB2"], ["tmp1"])) + self.assertEqual(all[3], (test_support.TESTFN, ["SUB1", "SUB2"], ["tmp1"])) self.assertEqual(all[flipped], (sub11_path, [], [])) self.assertEqual(all[flipped + 1], (sub1_path, ["SUB11"], ["tmp2"])) self.assertEqual(all[2 - 2 * flipped], (sub2_path, [], ["tmp3"])) @@ -295,18 +294,20 @@ # Windows, which doesn't have a recursive delete command. The # (not so) subtlety is that rmdir will fail unless the dir's # kids are removed first, so bottom up is essential. - for root, dirs, files in os.walk(TESTFN, topdown=False): + for root, dirs, files in os.walk(test_support.TESTFN, topdown=False): for name in files: os.remove(join(root, name)) for name in dirs: os.rmdir(join(root, name)) - os.rmdir(TESTFN) + os.rmdir(test_support.TESTFN) def test_main(): - run_classtests(TemporaryFileTests, - StatAttributeTests, - EnvironTests, - WalkTests) + test_support.run_unittest( + TemporaryFileTests, + StatAttributeTests, + EnvironTests, + WalkTests + ) if __name__ == "__main__": test_main() Index: Lib/test/test_parser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_parser.py,v retrieving revision 1.16 diff -u -r1.16 test_parser.py --- Lib/test/test_parser.py 19 Feb 2003 02:35:06 -0000 1.16 +++ Lib/test/test_parser.py 1 May 2003 16:42:27 -0000 @@ -374,11 +374,10 @@ self.check_bad_tree(tree, "malformed global ast") def test_main(): - loader = unittest.TestLoader() - suite = unittest.TestSuite() - suite.addTest(loader.loadTestsFromTestCase(RoundtripLegalSyntaxTestCase)) - suite.addTest(loader.loadTestsFromTestCase(IllegalSyntaxTestCase)) - test_support.run_suite(suite) + test_support.run_unittest( + RoundtripLegalSyntaxTestCase, + IllegalSyntaxTestCase + ) if __name__ == "__main__": Index: Lib/test/test_pep277.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pep277.py,v retrieving revision 1.5 diff -u -r1.5 test_pep277.py --- Lib/test/test_pep277.py 9 Nov 2002 05:26:15 -0000 1.5 +++ Lib/test/test_pep277.py 1 May 2003 16:42:27 -0000 @@ -1,9 +1,9 @@ # Test the Unicode versions of normal file functions # open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir import os, unittest -from test.test_support import TESTFN, TestSkipped, TestFailed, run_suite +from test import test_support if not os.path.supports_unicode_filenames: - raise TestSkipped, "test works only on NT+" + raise test_support.TestSkipped, "test works only on NT+" filenames = [ 'abc', @@ -28,11 +28,11 @@ os.rmdir(dirname) class UnicodeFileTests(unittest.TestCase): - files = [os.path.join(TESTFN, f) for f in filenames] + files = [os.path.join(test_support.TESTFN, f) for f in filenames] def setUp(self): try: - os.mkdir(TESTFN) + os.mkdir(test_support.TESTFN) except OSError: pass for name in self.files: @@ -42,17 +42,17 @@ os.stat(name) def tearDown(self): - deltree(TESTFN) + deltree(test_support.TESTFN) def _apply_failure(self, fn, filename, expected_exception, check_fn_in_exception = True): try: fn(filename) - raise TestFailed("Expected to fail calling '%s(%r)'" + raise test_support.TestFailed("Expected to fail calling '%s(%r)'" % (fn.__name__, filename)) except expected_exception, details: if check_fn_in_exception and details.filename != filename: - raise TestFailed("Function '%s(%r) failed with " + raise test_support.TestFailed("Function '%s(%r) failed with " "bad filename in the exception: %r" % (fn.__name__, filename, details.filename)) @@ -77,9 +77,9 @@ os.stat(name) def test_listdir(self): - f1 = os.listdir(TESTFN) + f1 = os.listdir(test_support.TESTFN) f1.sort() - f2 = os.listdir(unicode(TESTFN,"mbcs")) + f2 = os.listdir(unicode(test_support.TESTFN,"mbcs")) f2.sort() print f1 print f2 @@ -90,7 +90,7 @@ os.rename("tmp",name) def test_directory(self): - dirname = os.path.join(TESTFN,u'Gr\xfc\xdf-\u66e8\u66e9\u66eb') + dirname = os.path.join(test_support.TESTFN,u'Gr\xfc\xdf-\u66e8\u66e9\u66eb') filename = u'\xdf-\u66e8\u66e9\u66eb' oldwd = os.getcwd() os.mkdir(dirname) @@ -104,12 +104,10 @@ os.rmdir(dirname) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(UnicodeFileTests)) try: - run_suite(suite) + test_support.run_unittest(UnicodeFileTests) finally: - deltree(TESTFN) + deltree(test_support.TESTFN) if __name__ == "__main__": test_main() Index: Lib/test/test_pickle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pickle.py,v retrieving revision 1.17 diff -u -r1.17 test_pickle.py --- Lib/test/test_pickle.py 15 Feb 2003 03:01:09 -0000 1.17 +++ Lib/test/test_pickle.py 1 May 2003 16:42:27 -0000 @@ -62,12 +62,11 @@ return u.load() def test_main(): - loader = unittest.TestLoader() - suite = unittest.TestSuite() - suite.addTest(loader.loadTestsFromTestCase(PickleTests)) - suite.addTest(loader.loadTestsFromTestCase(PicklerTests)) - suite.addTest(loader.loadTestsFromTestCase(PersPicklerTests)) - test_support.run_suite(suite) + test_support.run_unittest( + PickleTests, + PicklerTests, + PersPicklerTests + ) test_support.run_doctest(pickle) if __name__ == "__main__": Index: Lib/test/test_posix.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_posix.py,v retrieving revision 1.5 diff -u -r1.5 test_posix.py --- Lib/test/test_posix.py 18 Mar 2003 13:30:14 -0000 1.5 +++ Lib/test/test_posix.py 1 May 2003 16:42:28 -0000 @@ -1,11 +1,11 @@ "Test posix functions" -from test.test_support import TestSkipped, TestFailed, TESTFN, run_suite +from test import test_support try: import posix except ImportError: - raise TestSkipped, "posix is not available" + raise test_support.TestSkipped, "posix is not available" import time import os @@ -19,11 +19,11 @@ def setUp(self): # create empty file - fp = open(TESTFN, 'w+') + fp = open(test_support.TESTFN, 'w+') fp.close() def tearDown(self): - os.unlink(TESTFN) + os.unlink(test_support.TESTFN) def testNoArgFunctions(self): # test posix functions which take no arguments and have @@ -46,7 +46,7 @@ def test_fstatvfs(self): if hasattr(posix, 'fstatvfs'): - fp = open(TESTFN) + fp = open(test_support.TESTFN) try: self.assert_(posix.fstatvfs(fp.fileno())) finally: @@ -54,7 +54,7 @@ def test_ftruncate(self): if hasattr(posix, 'ftruncate'): - fp = open(TESTFN, 'w+') + fp = open(test_support.TESTFN, 'w+') try: # we need to have some data to truncate fp.write('test') @@ -65,7 +65,7 @@ def test_dup(self): if hasattr(posix, 'dup'): - fp = open(TESTFN) + fp = open(test_support.TESTFN) try: fd = posix.dup(fp.fileno()) self.assert_(isinstance(fd, int)) @@ -75,8 +75,8 @@ def test_dup2(self): if hasattr(posix, 'dup2'): - fp1 = open(TESTFN) - fp2 = open(TESTFN) + fp1 = open(test_support.TESTFN) + fp2 = open(test_support.TESTFN) try: posix.dup2(fp1.fileno(), fp2.fileno()) finally: @@ -84,7 +84,7 @@ fp2.close() def fdopen_helper(self, *args): - fd = os.open(TESTFN, os.O_RDONLY) + fd = os.open(test_support.TESTFN, os.O_RDONLY) fp2 = posix.fdopen(fd, *args) fp2.close() @@ -96,7 +96,7 @@ def test_fstat(self): if hasattr(posix, 'fstat'): - fp = open(TESTFN) + fp = open(test_support.TESTFN) try: self.assert_(posix.fstat(fp.fileno())) finally: @@ -104,20 +104,20 @@ def test_stat(self): if hasattr(posix, 'stat'): - self.assert_(posix.stat(TESTFN)) + self.assert_(posix.stat(test_support.TESTFN)) def test_chdir(self): if hasattr(posix, 'chdir'): posix.chdir(os.curdir) - self.assertRaises(OSError, posix.chdir, TESTFN) + self.assertRaises(OSError, posix.chdir, test_support.TESTFN) def test_lsdir(self): if hasattr(posix, 'lsdir'): - self.assert_(TESTFN in posix.lsdir(os.curdir)) + self.assert_(test_support.TESTFN in posix.lsdir(os.curdir)) def test_access(self): if hasattr(posix, 'access'): - self.assert_(posix.access(TESTFN, os.R_OK)) + self.assert_(posix.access(test_support.TESTFN, os.R_OK)) def test_umask(self): if hasattr(posix, 'umask'): @@ -149,13 +149,11 @@ def test_utime(self): if hasattr(posix, 'utime'): now = time.time() - posix.utime(TESTFN, None) - posix.utime(TESTFN, (now, now)) + posix.utime(test_support.TESTFN, None) + posix.utime(test_support.TESTFN, (now, now)) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(PosixTester)) - run_suite(suite) + test_support.run_unittest(PosixTester) if __name__ == '__main__': test_main() Index: Lib/test/test_pow.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pow.py,v retrieving revision 1.17 diff -u -r1.17 test_pow.py --- Lib/test/test_pow.py 3 Feb 2003 20:17:19 -0000 1.17 +++ Lib/test/test_pow.py 1 May 2003 16:42:29 -0000 @@ -103,9 +103,7 @@ def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(PowTest)) - test.test_support.run_suite(suite) + test.test_support.run_unittest(PowTest) if __name__ == "__main__": test_main() Index: Lib/test/test_profilehooks.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_profilehooks.py,v retrieving revision 1.9 diff -u -r1.9 test_profilehooks.py --- Lib/test/test_profilehooks.py 23 Jul 2002 19:03:59 -0000 1.9 +++ Lib/test/test_profilehooks.py 1 May 2003 16:42:29 -0000 @@ -349,11 +349,10 @@ def test_main(): - loader = unittest.TestLoader() - suite = unittest.TestSuite() - suite.addTest(loader.loadTestsFromTestCase(ProfileHookTestCase)) - suite.addTest(loader.loadTestsFromTestCase(ProfileSimulatorTestCase)) - test_support.run_suite(suite) + test_support.run_unittest( + ProfileHookTestCase, + ProfileSimulatorTestCase + ) if __name__ == "__main__": Index: Lib/test/test_pwd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pwd.py,v retrieving revision 1.16 diff -u -r1.16 test_pwd.py --- Lib/test/test_pwd.py 24 Apr 2003 16:02:52 -0000 1.16 +++ Lib/test/test_pwd.py 1 May 2003 16:42:30 -0000 @@ -86,9 +86,7 @@ self.assertRaises(KeyError, pwd.getpwuid, fakeuid) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(PwdTest)) - test_support.run_suite(suite) + test_support.run_unittest(PwdTest) if __name__ == "__main__": test_main() Index: Lib/test/test_re.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_re.py,v retrieving revision 1.41 diff -u -r1.41 test_re.py --- Lib/test/test_re.py 27 Apr 2003 13:25:20 -0000 1.41 +++ Lib/test/test_re.py 1 May 2003 16:42:32 -0000 @@ -1,7 +1,7 @@ import sys sys.path = ['.'] + sys.path -from test.test_support import verbose, run_suite +from test.test_support import verbose, run_unittest import re from sre import Scanner import sys, os, traceback @@ -432,9 +432,7 @@ print '=== Fails on unicode-sensitive match', t def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(ReTests)) - run_suite(suite) + run_unittest(ReTests) run_re_tests() if __name__ == "__main__": Index: Lib/test/test_richcmp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_richcmp.py,v retrieving revision 1.8 diff -u -r1.8 test_richcmp.py --- Lib/test/test_richcmp.py 29 Apr 2003 21:31:18 -0000 1.8 +++ Lib/test/test_richcmp.py 1 May 2003 16:42:32 -0000 @@ -352,7 +352,7 @@ self.assertIs(op(x, y), True) def test_main(): - test_support.run_classtests(VectorTest, NumberTest, MiscTest, DictTest, ListTest) + test_support.run_unittest(VectorTest, NumberTest, MiscTest, DictTest, ListTest) if __name__ == "__main__": test_main() Index: Lib/test/test_sets.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sets.py,v retrieving revision 1.23 diff -u -r1.23 test_sets.py --- Lib/test/test_sets.py 2 Mar 2003 00:36:10 -0000 1.23 +++ Lib/test/test_sets.py 1 May 2003 16:42:33 -0000 @@ -658,42 +658,34 @@ #============================================================================== -def makeAllTests(): - suite = unittest.TestSuite() - for klass in (TestSetOfSets, - TestExceptionPropagation, - TestBasicOpsEmpty, - TestBasicOpsSingleton, - TestBasicOpsTuple, - TestBasicOpsTriple, - TestBinaryOps, - TestUpdateOps, - TestMutate, - TestSubsetEqualEmpty, - TestSubsetEqualNonEmpty, - TestSubsetEmptyNonEmpty, - TestSubsetPartial, - TestSubsetNonOverlap, - TestOnlySetsNumeric, - TestOnlySetsDict, - TestOnlySetsOperator, - TestCopyingEmpty, - TestCopyingSingleton, - TestCopyingTriple, - TestCopyingTuple, - TestCopyingNested, - ): - suite.addTest(unittest.makeSuite(klass)) - return suite - -#------------------------------------------------------------------------------ - __test__ = {'libreftest' : libreftest} def test_main(verbose=None): from test import test_sets - suite = makeAllTests() - test_support.run_suite(suite) + test_support.run_unittest( + TestSetOfSets, + TestExceptionPropagation, + TestBasicOpsEmpty, + TestBasicOpsSingleton, + TestBasicOpsTuple, + TestBasicOpsTriple, + TestBinaryOps, + TestUpdateOps, + TestMutate, + TestSubsetEqualEmpty, + TestSubsetEqualNonEmpty, + TestSubsetEmptyNonEmpty, + TestSubsetPartial, + TestSubsetNonOverlap, + TestOnlySetsNumeric, + TestOnlySetsDict, + TestOnlySetsOperator, + TestCopyingEmpty, + TestCopyingSingleton, + TestCopyingTriple, + TestCopyingTuple, + TestCopyingNested + ) test_support.run_doctest(test_sets, verbose) if __name__ == "__main__": Index: Lib/test/test_shelve.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_shelve.py,v retrieving revision 1.4 diff -u -r1.4 test_shelve.py --- Lib/test/test_shelve.py 19 Apr 2003 20:59:02 -0000 1.4 +++ Lib/test/test_shelve.py 1 May 2003 16:42:34 -0000 @@ -121,15 +121,15 @@ _in_mem = True def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(TestAsciiFileShelve)) - suite.addTest(unittest.makeSuite(TestBinaryFileShelve)) - suite.addTest(unittest.makeSuite(TestProto2FileShelve)) - suite.addTest(unittest.makeSuite(TestAsciiMemShelve)) - suite.addTest(unittest.makeSuite(TestBinaryMemShelve)) - suite.addTest(unittest.makeSuite(TestProto2MemShelve)) - suite.addTest(unittest.makeSuite(TestCase)) - test_support.run_suite(suite) + test_support.run_unittest( + TestAsciiFileShelve, + TestBinaryFileShelve, + TestProto2FileShelve, + TestAsciiMemShelve, + TestBinaryMemShelve, + TestProto2MemShelve, + TestCase + ) if __name__ == "__main__": test_main() Index: Lib/test/test_shutil.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_shutil.py,v retrieving revision 1.1 diff -u -r1.1 test_shutil.py --- Lib/test/test_shutil.py 24 Jan 2003 17:34:13 -0000 1.1 +++ Lib/test/test_shutil.py 1 May 2003 16:42:34 -0000 @@ -14,15 +14,9 @@ -def suite(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(TestShutil)) - return suite - - def test_main(): - test_support.run_suite(suite()) + test_support.run_unittest(TestShutil) if __name__ == '__main__': - unittest.main(defaultTest='suite') + test_main() Index: Lib/test/test_socket.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_socket.py,v retrieving revision 1.63 diff -u -r1.63 test_socket.py --- Lib/test/test_socket.py 25 Apr 2003 15:11:23 -0000 1.63 +++ Lib/test/test_socket.py 1 May 2003 16:42:35 -0000 @@ -683,17 +683,18 @@ bufsize = 2 # Exercise the buffering code def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(GeneralModuleTests)) - suite.addTest(unittest.makeSuite(BasicTCPTest)) + tests = [ GeneralModuleTests, BasicTCPTest ] if sys.platform != 'mac': - suite.addTest(unittest.makeSuite(BasicUDPTest)) - suite.addTest(unittest.makeSuite(NonBlockingTCPTests)) - suite.addTest(unittest.makeSuite(FileObjectClassTestCase)) - suite.addTest(unittest.makeSuite(UnbufferedFileObjectClassTestCase)) - suite.addTest(unittest.makeSuite(LineBufferedFileObjectClassTestCase)) - suite.addTest(unittest.makeSuite(SmallBufferedFileObjectClassTestCase)) - test_support.run_suite(suite) + tests.append(BasicUDPTest) + + tests.extend([ + NonBlockingTCPTests, + FileObjectClassTestCase, + UnbufferedFileObjectClassTestCase, + LineBufferedFileObjectClassTestCase, + SmallBufferedFileObjectClassTestCase + ]) + test_support.run_unittest(*tests) if __name__ == "__main__": test_main() Index: Lib/test/test_str.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_str.py,v retrieving revision 1.2 diff -u -r1.2 test_str.py --- Lib/test/test_str.py 31 Mar 2003 18:07:49 -0000 1.2 +++ Lib/test/test_str.py 1 May 2003 16:42:35 -0000 @@ -19,9 +19,7 @@ self.assertRaises(OverflowError, '%c'.__mod__, 0x1234) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(StrTest)) - test_support.run_suite(suite) + test_support.run_unittest(StrTest) if __name__ == "__main__": test_main() Index: Lib/test/test_string.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_string.py,v retrieving revision 1.24 diff -u -r1.24 test_string.py --- Lib/test/test_string.py 21 Feb 2003 12:53:49 -0000 1.24 +++ Lib/test/test_string.py 1 May 2003 16:42:35 -0000 @@ -95,10 +95,7 @@ self.assertEqual(string.capwords('ABC-def DEF-ghi GHI'), 'Abc-def Def-ghi Ghi') def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(StringTest)) - suite.addTest(unittest.makeSuite(ModuleTest)) - test_support.run_suite(suite) + test_support.run_unittest(StringTest, ModuleTest) if __name__ == "__main__": test_main() Index: Lib/test/test_strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v retrieving revision 1.12 diff -u -r1.12 test_strptime.py --- Lib/test/test_strptime.py 28 Apr 2003 21:30:13 -0000 1.12 +++ Lib/test/test_strptime.py 1 May 2003 16:42:36 -0000 @@ -406,14 +406,14 @@ "%s != %s" % (result.tm_wday, self.time_tuple.tm_wday)) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(LocaleTime_Tests)) - suite.addTest(unittest.makeSuite(TimeRETests)) - suite.addTest(unittest.makeSuite(StrptimeTests)) - suite.addTest(unittest.makeSuite(Strptime12AMPMTests)) - suite.addTest(unittest.makeSuite(JulianTests)) - suite.addTest(unittest.makeSuite(CalculationTests)) - test_support.run_suite(suite) + test_support.run_unittest( + LocaleTime_Tests, + TimeRETests, + StrptimeTests, + Strptime12AMPMTests, + JulianTests, + CalculationTests + ) if __name__ == '__main__': Index: Lib/test/test_support.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_support.py,v retrieving revision 1.51 diff -u -r1.51 test_support.py --- Lib/test/test_support.py 27 Apr 2003 07:54:23 -0000 1.51 +++ Lib/test/test_support.py 1 May 2003 16:42:37 -0000 @@ -229,13 +229,10 @@ raise TestFailed(err) -def run_unittest(testclass): - """Run tests from a unittest.TestCase-derived class.""" - run_suite(unittest.makeSuite(testclass), testclass) - -def run_classtests(*classnames): +def run_unittest(*classes): + """Run tests from unittest.TestCase-derived classes.""" suite = unittest.TestSuite() - for cls in classnames: + for cls in classes: suite.addTest(unittest.makeSuite(cls)) run_suite(suite) Index: Lib/test/test_sys.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sys.py,v retrieving revision 1.6 diff -u -r1.6 test_sys.py --- Lib/test/test_sys.py 1 Mar 2003 03:25:41 -0000 1.6 +++ Lib/test/test_sys.py 1 May 2003 16:42:38 -0000 @@ -247,9 +247,7 @@ self.assert_(isinstance(vi[4], int)) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(SysModuleTest)) - test.test_support.run_suite(suite) + test.test_support.run_unittest(SysModuleTest) if __name__ == "__main__": test_main() Index: Lib/test/test_tarfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_tarfile.py,v retrieving revision 1.7 diff -u -r1.7 test_tarfile.py --- Lib/test/test_tarfile.py 14 Apr 2003 01:18:32 -0000 1.7 +++ Lib/test/test_tarfile.py 1 May 2003 16:42:38 -0000 @@ -240,27 +240,26 @@ # create testtar.tar.bz2 bz2.BZ2File(tarname("bz2"), "wb").write(file(tarname(), "rb").read()) - try: - suite = unittest.TestSuite() - - suite.addTest(unittest.makeSuite(ReadTest)) - suite.addTest(unittest.makeSuite(ReadStreamTest)) - suite.addTest(unittest.makeSuite(WriteTest)) - suite.addTest(unittest.makeSuite(WriteStreamTest)) + tests = [ + ReadTest, + ReadStreamTest, + WriteTest, + WriteStreamTest + ] - if gzip: - suite.addTest(unittest.makeSuite(ReadTestGzip)) - suite.addTest(unittest.makeSuite(ReadStreamTestGzip)) - suite.addTest(unittest.makeSuite(WriteTestGzip)) - suite.addTest(unittest.makeSuite(WriteStreamTestGzip)) + if gzip: + tests.extend([ + ReadTestGzip, ReadStreamTestGzip, + WriteTestGzip, WriteStreamTestGzip + ]) - if bz2: - suite.addTest(unittest.makeSuite(ReadTestBzip2)) - suite.addTest(unittest.makeSuite(ReadStreamTestBzip2)) - suite.addTest(unittest.makeSuite(WriteTestBzip2)) - suite.addTest(unittest.makeSuite(WriteStreamTestBzip2)) - - test_support.run_suite(suite) + if bz2: + tests.extend([ + ReadTestBzip2, ReadStreamTestBzip2, + WriteTestBzip2, WriteStreamTestBzip2 + ]) + try: + test_support.run_unittest(*tests) finally: if gzip: os.remove(tarname("gz")) Index: Lib/test/test_tempfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_tempfile.py,v retrieving revision 1.13 diff -u -r1.13 test_tempfile.py --- Lib/test/test_tempfile.py 8 Jan 2003 16:30:34 -0000 1.13 +++ Lib/test/test_tempfile.py 1 May 2003 16:42:40 -0000 @@ -645,10 +645,7 @@ test_classes.append(test_TemporaryFile) def test_main(): - suite = unittest.TestSuite() - for c in test_classes: - suite.addTest(unittest.makeSuite(c)) - test_support.run_suite(suite) + test_support.run_unittest(*test_classes) if __name__ == "__main__": test_main() Index: Lib/test/test_textwrap.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_textwrap.py,v retrieving revision 1.18 diff -u -r1.18 test_textwrap.py --- Lib/test/test_textwrap.py 9 Dec 2002 16:32:41 -0000 1.18 +++ Lib/test/test_textwrap.py 1 May 2003 16:42:41 -0000 @@ -352,11 +352,7 @@ def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(WrapTestCase)) - suite.addTest(unittest.makeSuite(LongWordTestCase)) - suite.addTest(unittest.makeSuite(IndentTestCases)) - test_support.run_suite(suite) + test_support.run_unittest(WrapTestCase, LongWordTestCase, IndentTestCases) if __name__ == '__main__': test_main() Index: Lib/test/test_timeout.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_timeout.py,v retrieving revision 1.13 diff -u -r1.13 test_timeout.py --- Lib/test/test_timeout.py 11 Apr 2003 15:14:05 -0000 1.13 +++ Lib/test/test_timeout.py 1 May 2003 16:42:41 -0000 @@ -186,10 +186,7 @@ def test_main(): test_support.requires('network') - - suite = unittest.makeSuite(CreationTestCase) - suite.addTest(unittest.makeSuite(TimeoutTestCase)) - test_support.run_suite(suite) + test_support.run_unittest(CreationTestCase, TimeoutTestCase) if __name__ == "__main__": test_main() Index: Lib/test/test_trace.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_trace.py,v retrieving revision 1.8 diff -u -r1.8 test_trace.py --- Lib/test/test_trace.py 29 Apr 2003 16:18:47 -0000 1.8 +++ Lib/test/test_trace.py 1 May 2003 16:42:42 -0000 @@ -531,9 +531,11 @@ no_jump_without_trace_function() def test_main(): - test_support.run_unittest(TraceTestCase) - test_support.run_unittest(RaisingTraceFuncTestCase) - test_support.run_unittest(JumpTestCase) + test_support.run_unittest( + TraceTestCase, + RaisingTraceFuncTestCase, + JumpTestCase + ) if __name__ == "__main__": test_main() Index: Lib/test/test_ucn.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_ucn.py,v retrieving revision 1.13 diff -u -r1.13 test_ucn.py --- Lib/test/test_ucn.py 7 Mar 2003 17:30:48 -0000 1.13 +++ Lib/test/test_ucn.py 1 May 2003 16:42:44 -0000 @@ -138,9 +138,7 @@ ) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(UnicodeNamesTest)) - test_support.run_suite(suite) + test_support.run_unittest(UnicodeNamesTest) if __name__ == "__main__": test_main() Index: Lib/test/test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.82 diff -u -r1.82 test_unicode.py --- Lib/test/test_unicode.py 2 Apr 2003 16:37:24 -0000 1.82 +++ Lib/test/test_unicode.py 1 May 2003 16:42:47 -0000 @@ -698,9 +698,7 @@ print >>out, u'def\n' def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(UnicodeTest)) - test_support.run_suite(suite) + test_support.run_unittest(UnicodeTest) if __name__ == "__main__": test_main() Index: Lib/test/test_unicodedata.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicodedata.py,v retrieving revision 1.8 diff -u -r1.8 test_unicodedata.py --- Lib/test/test_unicodedata.py 7 Mar 2003 17:30:48 -0000 1.8 +++ Lib/test/test_unicodedata.py 1 May 2003 16:42:47 -0000 @@ -203,11 +203,11 @@ self.assert_(count >= 10) # should have tested at least the ASCII digits def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(UnicodeMiscTest)) - suite.addTest(unittest.makeSuite(UnicodeMethodsTest)) - suite.addTest(unittest.makeSuite(UnicodeFunctionsTest)) - test.test_support.run_suite(suite) + test.test_support.run_unittest( + UnicodeMiscTest, + UnicodeMethodsTest, + UnicodeFunctionsTest + ) if __name__ == "__main__": test_main() Index: Lib/test/test_univnewlines.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_univnewlines.py,v retrieving revision 1.4 diff -u -r1.4 test_univnewlines.py --- Lib/test/test_univnewlines.py 23 Jul 2002 19:04:08 -0000 1.4 +++ Lib/test/test_univnewlines.py 1 May 2003 16:42:47 -0000 @@ -111,11 +111,13 @@ def test_main(): - test_support.run_unittest(TestNativeNewlines) - test_support.run_unittest(TestCRNewlines) - test_support.run_unittest(TestLFNewlines) - test_support.run_unittest(TestCRLFNewlines) - test_support.run_unittest(TestMixedNewlines) + test_support.run_unittest( + TestNativeNewlines, + TestCRNewlines, + TestLFNewlines, + TestCRLFNewlines, + TestMixedNewlines + ) if __name__ == '__main__': test_main() Index: Lib/test/test_urllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urllib.py,v retrieving revision 1.12 diff -u -r1.12 test_urllib.py --- Lib/test/test_urllib.py 29 Apr 2003 05:08:06 -0000 1.12 +++ Lib/test/test_urllib.py 1 May 2003 16:42:48 -0000 @@ -408,14 +408,14 @@ def test_main(): - test_suite = unittest.TestSuite() - test_suite.addTest(unittest.makeSuite(urlopen_FileTests)) - test_suite.addTest(unittest.makeSuite(urlretrieve_FileTests)) - test_suite.addTest(unittest.makeSuite(QuotingTests)) - test_suite.addTest(unittest.makeSuite(UnquotingTests)) - test_suite.addTest(unittest.makeSuite(urlencode_Tests)) - test_suite.addTest(unittest.makeSuite(Pathname_Tests)) - test_support.run_suite(test_suite) + test_support.run_unittest( + urlopen_FileTests, + urlretrieve_FileTests, + QuotingTests, + UnquotingTests, + urlencode_Tests, + Pathname_Tests + ) Index: Lib/test/test_urllibnet.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urllibnet.py,v retrieving revision 1.1 diff -u -r1.1 test_urllibnet.py --- Lib/test/test_urllibnet.py 30 Mar 2003 04:54:24 -0000 1.1 +++ Lib/test/test_urllibnet.py 1 May 2003 16:42:48 -0000 @@ -23,10 +23,7 @@ def test_main(): test_support.requires('network') - - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(URLTimeoutTest)) - test_support.run_suite(suite) + test_support.run_unittest(URLTimeoutTest) if __name__ == "__main__": test_main() Index: Lib/test/test_userdict.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_userdict.py,v retrieving revision 1.14 diff -u -r1.14 test_userdict.py --- Lib/test/test_userdict.py 9 Mar 2003 07:05:14 -0000 1.14 +++ Lib/test/test_userdict.py 1 May 2003 16:42:49 -0000 @@ -395,11 +395,11 @@ self.assertEqual(s, t) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(TestMappingProtocol)) - suite.addTest(unittest.makeSuite(UserDictTest)) - suite.addTest(unittest.makeSuite(UserDictMixinTest)) - test.test_support.run_suite(suite) + test.test_support.run_unittest( + TestMappingProtocol, + UserDictTest, + UserDictMixinTest + ) if __name__ == "__main__": test_main() Index: Lib/test/test_userlist.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_userlist.py,v retrieving revision 1.8 diff -u -r1.8 test_userlist.py --- Lib/test/test_userlist.py 19 Feb 2003 02:35:06 -0000 1.8 +++ Lib/test/test_userlist.py 1 May 2003 16:42:49 -0000 @@ -252,9 +252,7 @@ self.assertEqual(u, [0, 1, 0, 1, 0, 1]) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(UserListTest)) - test.test_support.run_suite(suite) + test.test_support.run_unittest(UserListTest) if __name__ == "__main__": test_main() Index: Lib/test/test_userstring.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_userstring.py,v retrieving revision 1.10 diff -u -r1.10 test_userstring.py --- Lib/test/test_userstring.py 21 Feb 2003 12:53:49 -0000 1.10 +++ Lib/test/test_userstring.py 1 May 2003 16:42:49 -0000 @@ -44,9 +44,7 @@ getattr(object, methodname)(*args) def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(UserStringTest)) - test_support.run_suite(suite) + test_support.run_unittest(UserStringTest) if __name__ == "__main__": test_main() Index: Lib/test/test_weakref.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_weakref.py,v retrieving revision 1.22 diff -u -r1.22 test_weakref.py --- Lib/test/test_weakref.py 9 Mar 2003 07:05:14 -0000 1.22 +++ Lib/test/test_weakref.py 1 May 2003 16:42:49 -0000 @@ -534,12 +534,12 @@ return self.__ref.copy() def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(ReferencesTestCase)) - suite.addTest(unittest.makeSuite(MappingTestCase)) - suite.addTest(unittest.makeSuite(WeakValueDictionaryTestCase)) - suite.addTest(unittest.makeSuite(WeakKeyDictionaryTestCase)) - test_support.run_suite(suite) + test_support.run_unittest( + ReferencesTestCase, + MappingTestCase, + WeakValueDictionaryTestCase, + WeakKeyDictionaryTestCase + ) if __name__ == "__main__": Index: Lib/test/test_xpickle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_xpickle.py,v retrieving revision 1.3 diff -u -r1.3 test_xpickle.py --- Lib/test/test_xpickle.py 19 Feb 2003 02:35:06 -0000 1.3 +++ Lib/test/test_xpickle.py 1 May 2003 16:42:50 -0000 @@ -35,12 +35,10 @@ return cPickle.loads(buf) def test_main(): - suite = unittest.TestSuite() - for test in (DumpCPickle_LoadPickle, - DumpPickle_LoadCPickle, - ): - suite.addTest(unittest.makeSuite(test)) - test_support.run_suite(suite) + test_support.run_unittest( + DumpCPickle_LoadPickle, + DumpPickle_LoadCPickle + ) if __name__ == "__main__": test_main() Index: Lib/test/test_zipimport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_zipimport.py,v retrieving revision 1.7 diff -u -r1.7 test_zipimport.py --- Lib/test/test_zipimport.py 19 Feb 2003 02:35:06 -0000 1.7 +++ Lib/test/test_zipimport.py 1 May 2003 16:42:50 -0000 @@ -187,8 +187,10 @@ def test_main(): - test_support.run_unittest(UncompressedZipImportTestCase) - test_support.run_unittest(CompressedZipImportTestCase) + test_support.run_unittest( + UncompressedZipImportTestCase, + CompressedZipImportTestCase + ) if __name__ == "__main__": test_main() Index: Lib/test/test_zlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_zlib.py,v retrieving revision 1.22 diff -u -r1.22 test_zlib.py --- Lib/test/test_zlib.py 27 Feb 2003 18:39:18 -0000 1.22 +++ Lib/test/test_zlib.py 1 May 2003 16:42:50 -0000 @@ -479,24 +479,24 @@ def test_main(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(ChecksumTestCase)) - suite.addTest(unittest.makeSuite(ExceptionTestCase)) - suite.addTest(unittest.makeSuite(CompressTestCase)) - suite.addTest(unittest.makeSuite(CompressObjectTestCase)) - test_support.run_suite(suite) + test_support.run_unittest( + ChecksumTestCase, + ExceptionTestCase, + CompressTestCase, + CompressObjectTestCase + ) if __name__ == "__main__": test_main() def test(tests=''): if not tests: tests = 'o' - suite = unittest.TestSuite() - if 'k' in tests: suite.addTest(unittest.makeSuite(ChecksumTestCase)) - if 'x' in tests: suite.addTest(unittest.makeSuite(ExceptionTestCase)) - if 'c' in tests: suite.addTest(unittest.makeSuite(CompressTestCase)) - if 'o' in tests: suite.addTest(unittest.makeSuite(CompressObjectTestCase)) - test_support.run_suite(suite) + testcases = [] + if 'k' in tests: testcases.append(ChecksumTestCase) + if 'x' in tests: testcases.append(ExceptionTestCase) + if 'c' in tests: testcases.append(CompressTestCase) + if 'o' in tests: testcases.append(CompressObjectTestCase) + test_support.run_unittest(*testcases) if False: import sys