[Python-checkins] r54956 - in python/trunk: Doc/lib/libtest.tex Lib/test/README Lib/test/test_base64.py Lib/test/test_bsddb3.py Lib/test/test_codecencodings_cn.py Lib/test/test_codecencodings_hk.py Lib/test/test_codecencodings_jp.py Lib/test/test_codecencodings_kr.py Lib/test/test_codecencodings_tw.py Lib/test/test_codecmaps_cn.py Lib/test/test_codecmaps_hk.py Lib/test/test_codecmaps_jp.py Lib/test/test_codecmaps_kr.py Lib/test/test_codecmaps_tw.py Lib/test/test_contextlib.py Lib/test/test_ctypes.py Lib/test/test_datetime.py Lib/test/test_email.py Lib/test/test_email_codecs.py Lib/test/test_email_renamed.py Lib/test/test_gettext.py Lib/test/test_multibytecodec.py Lib/test/test_optparse.py Lib/test/test_robotparser.py Lib/test/test_support.py Lib/test/test_threading_local.py Lib/test/test_unicode.py Lib/test/test_unicode_file.py Lib/test/test_wsgiref.py (original) (raw)
collin.winter python-checkins at python.org
Wed Apr 25 19:29:57 CEST 2007
- Previous message: [Python-checkins] r54955 - peps/trunk/pep-3119.txt
- Next message: [Python-checkins] r54957 - python/trunk/Lib/test/test_datetime.py
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: collin.winter Date: Wed Apr 25 19:29:52 2007 New Revision: 54956
Modified: python/trunk/Doc/lib/libtest.tex python/trunk/Lib/test/README python/trunk/Lib/test/test_base64.py python/trunk/Lib/test/test_bsddb3.py python/trunk/Lib/test/test_codecencodings_cn.py python/trunk/Lib/test/test_codecencodings_hk.py python/trunk/Lib/test/test_codecencodings_jp.py python/trunk/Lib/test/test_codecencodings_kr.py python/trunk/Lib/test/test_codecencodings_tw.py python/trunk/Lib/test/test_codecmaps_cn.py python/trunk/Lib/test/test_codecmaps_hk.py python/trunk/Lib/test/test_codecmaps_jp.py python/trunk/Lib/test/test_codecmaps_kr.py python/trunk/Lib/test/test_codecmaps_tw.py python/trunk/Lib/test/test_contextlib.py python/trunk/Lib/test/test_ctypes.py python/trunk/Lib/test/test_datetime.py python/trunk/Lib/test/test_email.py python/trunk/Lib/test/test_email_codecs.py python/trunk/Lib/test/test_email_renamed.py python/trunk/Lib/test/test_gettext.py python/trunk/Lib/test/test_multibytecodec.py python/trunk/Lib/test/test_optparse.py python/trunk/Lib/test/test_robotparser.py python/trunk/Lib/test/test_support.py python/trunk/Lib/test/test_threading_local.py python/trunk/Lib/test/test_unicode.py python/trunk/Lib/test/test_unicode_file.py python/trunk/Lib/test/test_wsgiref.py Log: Standardize on test.test_support.run_unittest() (as opposed to a mix of run_unittest() and run_suite()). Also, add functionality to run_unittest() that admits usage of unittest.TestLoader.loadTestsFromModule().
Modified: python/trunk/Doc/lib/libtest.tex
--- python/trunk/Doc/lib/libtest.tex (original) +++ python/trunk/Doc/lib/libtest.tex Wed Apr 25 19:29:52 2007 @@ -196,7 +196,9 @@ This module defines the following exceptions:
\begin{excdesc}{TestFailed} -Exception to be raised when a test fails. +Exception to be raised when a test fails. This is deprecated in favor +of \module{unittest}-based tests and \class{unittest.TestCase}'s +assertion methods. \end{excdesc}
\begin{excdesc}{TestSkipped} @@ -273,14 +275,18 @@ Execute \class{unittest.TestCase} subclasses passed to the function. The function scans the classes for methods starting with the prefix \samp{test_} and executes the tests individually. -This is the preferred way to execute tests. -\end{funcdesc}
-\begin{funcdesc}{run_suite}{suite\optional{, testclass}} -Execute the \class{unittest.TestSuite} instance \var{suite}. -The optional argument \var{testclass} accepts one of the test classes in the -suite so as to print out more detailed information on where the testing suite -originated from. +It is also legal to pass strings as parameters; these should be keys in +\code{sys.modules}. Each associated module will be scanned by +\code{unittest.TestLoader.loadTestsFromModule()}. This is usually seen in +the following \function{test_main()} function: + +\begin{verbatim} +def test_main():
- test_support.run_unittest(name)
+\end{verbatim} + +This will run all tests defined in the named module. \end{funcdesc}
The \module{test.test_support} module defines the following classes:
Modified: python/trunk/Lib/test/README
--- python/trunk/Lib/test/README (original) +++ python/trunk/Lib/test/README Wed Apr 25 19:29:52 2007 @@ -40,18 +40,22 @@ see the documentation of the unittest_ module for detailed information on the interface and general guidelines on writing unittest-based tests. -The test_support helper module provides two functions for use by -unittest-based tests in the Python regression testing framework:
-- run_unittest()
takes a number of unittest.TestCase
derived classes as
- parameters and runs the tests defined in those classes.
-- run_suite()
takes a populated TestSuite
instance and runs the
- tests.
+The test_support helper module provides a function for use by
+unittest-based tests in the Python regression testing framework,
+run_unittest()
. This is the primary way of running tests in the
+standard library. You can pass it any number of the following:
+
+- classes derived from or instances of unittest.TestCase
or
+ unittest.TestSuite
. These will be handed off to unittest for
+ converting into a proper TestSuite instance.
+
+- a string; this must be a key in sys.modules. The module associated with
+ that string will be scanned by unittest.TestLoader.loadTestsFromModule
.
+ This is usually seen as test_support.run_unittest(__name__)
in a test
+ module's test_main()
function. This has the advantage of picking up
+ new tests automatically, without you having to add each new test case
+ manually.
-run_suite()
is preferred because unittest files typically grow multiple
-test classes, and you might as well be prepared.
All test methods in the Python regression framework have names that
start with "test_
" and use lower-case names with words separated with
underscores.
@@ -96,11 +100,7 @@
...etc...
def test_main():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(MyTestCase1))
suite.addTest(unittest.makeSuite(MyTestCase2))
...add more suites...
test_support.run_suite(suite)
if name == "main": test_main()test_support.run_unittest(__name__)
Modified: python/trunk/Lib/test/test_base64.py
--- python/trunk/Lib/test/test_base64.py (original) +++ python/trunk/Lib/test/test_base64.py Wed Apr 25 19:29:52 2007 @@ -183,16 +183,8 @@ -def suite(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(LegacyBase64TestCase)) - suite.addTest(unittest.makeSuite(BaseXYTestCase)) - return suite
- def test_main():
- test_support.run_suite(suite())
- test_support.run_unittest(name)
if name == 'main':
- unittest.main(defaultTest='suite')
- test_main()
Modified: python/trunk/Lib/test/test_bsddb3.py
--- python/trunk/Lib/test/test_bsddb3.py (original) +++ python/trunk/Lib/test/test_bsddb3.py Wed Apr 25 19:29:52 2007 @@ -4,11 +4,11 @@ """ import sys import unittest -from test.test_support import requires, verbose, run_suite, unlink +from test.test_support import requires, verbose, run_unittest, unlink # When running as a script instead of within the regrtest framework, skip the # requires test, since it's obvious we want to run them. -if name <> 'main': +if name != 'main': requires('bsddb') verbose = False @@ -58,9 +58,7 @@ # For invocation through regrtest def test_main(): - tests = suite() - run_suite(tests)
- run_unittest(suite())
For invocation as a script
if name == 'main': @@ -73,4 +71,4 @@ print 'python version: %s' % sys.version print '-=' * 38
- unittest.main(defaultTest='suite')
- test_main()
Modified: python/trunk/Lib/test/test_codecencodings_cn.py
--- python/trunk/Lib/test/test_codecencodings_cn.py (original) +++ python/trunk/Lib/test/test_codecencodings_cn.py Wed Apr 25 19:29:52 2007 @@ -51,11 +51,7 @@ has_iso10646 = True
def test_main():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(Test_GB2312))
- suite.addTest(unittest.makeSuite(Test_GBK))
- suite.addTest(unittest.makeSuite(Test_GB18030))
- test_support.run_suite(suite)
- test_support.run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_codecencodings_hk.py
--- python/trunk/Lib/test/test_codecencodings_hk.py (original) +++ python/trunk/Lib/test/test_codecencodings_hk.py Wed Apr 25 19:29:52 2007 @@ -21,9 +21,7 @@ )
def test_main():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(Test_Big5HKSCS))
- test_support.run_suite(suite)
- test_support.run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_codecencodings_jp.py
--- python/trunk/Lib/test/test_codecencodings_jp.py (original) +++ python/trunk/Lib/test/test_codecencodings_jp.py Wed Apr 25 19:29:52 2007 @@ -99,13 +99,7 @@ )
def test_main():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(Test_CP932))
- suite.addTest(unittest.makeSuite(Test_EUC_JISX0213))
- suite.addTest(unittest.makeSuite(Test_EUC_JP_COMPAT))
- suite.addTest(unittest.makeSuite(Test_SJIS_COMPAT))
- suite.addTest(unittest.makeSuite(Test_SJISX0213))
- test_support.run_suite(suite)
- test_support.run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_codecencodings_kr.py
--- python/trunk/Lib/test/test_codecencodings_kr.py (original) +++ python/trunk/Lib/test/test_codecencodings_kr.py Wed Apr 25 19:29:52 2007 @@ -45,11 +45,7 @@ )
def test_main():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(Test_CP949))
- suite.addTest(unittest.makeSuite(Test_EUCKR))
- suite.addTest(unittest.makeSuite(Test_JOHAB))
- test_support.run_suite(suite)
- test_support.run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_codecencodings_tw.py
--- python/trunk/Lib/test/test_codecencodings_tw.py (original) +++ python/trunk/Lib/test/test_codecencodings_tw.py Wed Apr 25 19:29:52 2007 @@ -21,9 +21,7 @@ )
def test_main():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(Test_Big5))
- test_support.run_suite(suite)
- test_support.run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_codecmaps_cn.py
--- python/trunk/Lib/test/test_codecmaps_cn.py (original) +++ python/trunk/Lib/test/test_codecmaps_cn.py Wed Apr 25 19:29:52 2007 @@ -20,10 +20,7 @@ 'MICSFT/WINDOWS/CP936.TXT'
def test_main():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(TestGB2312Map))
- suite.addTest(unittest.makeSuite(TestGBKMap))
- test_support.run_suite(suite)
- test_support.run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_codecmaps_hk.py
--- python/trunk/Lib/test/test_codecmaps_hk.py (original) +++ python/trunk/Lib/test/test_codecmaps_hk.py Wed Apr 25 19:29:52 2007 @@ -14,9 +14,7 @@ mapfileurl = 'http://people.freebsd.org/~perky/i18n/BIG5HKSCS.TXT'
def test_main():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(TestBig5HKSCSMap))
- test_support.run_suite(suite)
- test_support.run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_codecmaps_jp.py
--- python/trunk/Lib/test/test_codecmaps_jp.py (original) +++ python/trunk/Lib/test/test_codecmaps_jp.py Wed Apr 25 19:29:52 2007 @@ -61,13 +61,7 @@
def test_main():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(TestCP932Map))
- suite.addTest(unittest.makeSuite(TestEUCJPCOMPATMap))
- suite.addTest(unittest.makeSuite(TestSJISCOMPATMap))
- suite.addTest(unittest.makeSuite(TestEUCJISX0213Map))
- suite.addTest(unittest.makeSuite(TestSJISX0213Map))
- test_support.run_suite(suite)
- test_support.run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_codecmaps_kr.py
--- python/trunk/Lib/test/test_codecmaps_kr.py (original) +++ python/trunk/Lib/test/test_codecmaps_kr.py Wed Apr 25 19:29:52 2007 @@ -34,11 +34,7 @@ pass_dectest = [('\', u'\u20a9')]
def test_main():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(TestCP949Map))
- suite.addTest(unittest.makeSuite(TestEUCKRMap))
- suite.addTest(unittest.makeSuite(TestJOHABMap))
- test_support.run_suite(suite)
- test_support.run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_codecmaps_tw.py
--- python/trunk/Lib/test/test_codecmaps_tw.py (original) +++ python/trunk/Lib/test/test_codecmaps_tw.py Wed Apr 25 19:29:52 2007 @@ -25,10 +25,7 @@ ]
def test_main():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(TestBIG5Map))
- suite.addTest(unittest.makeSuite(TestCP950Map))
- test_support.run_suite(suite)
- test_support.run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_contextlib.py
--- python/trunk/Lib/test/test_contextlib.py (original) +++ python/trunk/Lib/test/test_contextlib.py Wed Apr 25 19:29:52 2007 @@ -9,7 +9,7 @@ import unittest import threading from contextlib import * # Tests all -from test.test_support import run_suite +from test import test_support
class ContextManagerTestCase(unittest.TestCase):
@@ -332,9 +332,7 @@
This is needed to make the test actually run under regrtest.py!
def test_main():
- run_suite(
unittest.defaultTestLoader.loadTestsFromModule(sys.modules[__name__])
- )
- test_support.run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_ctypes.py
--- python/trunk/Lib/test/test_ctypes.py (original) +++ python/trunk/Lib/test/test_ctypes.py Wed Apr 25 19:29:52 2007 @@ -1,12 +1,12 @@ import unittest
-from test.test_support import run_suite +from test.test_support import run_unittest import ctypes.test
def test_main(): skipped, testcases = ctypes.test.get_tests(ctypes.test, "test_*.py", verbosity=0) suites = [unittest.makeSuite(t) for t in testcases]
- run_suite(unittest.TestSuite(suites))
- run_unittest(unittest.TestSuite(suites))
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_datetime.py
--- python/trunk/Lib/test/test_datetime.py (original) +++ python/trunk/Lib/test/test_datetime.py Wed Apr 25 19:29:52 2007 @@ -128,7 +128,7 @@ # Base clase for testing a particular aspect of timedelta, time, date and # datetime comparisons. -class HarmlessMixedComparison(unittest.TestCase): +class HarmlessMixedComparison: # Test that eq and ne don't complain for mixed-type comparisons. # Subclasses must define 'theclass', and theclass(1, 1, 1) must be a @@ -167,7 +167,7 @@ ############################################################################# # timedelta tests -class TestTimeDelta(HarmlessMixedComparison): +class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase): theclass = timedelta @@ -514,7 +514,7 @@ class SubclassDate(date): sub_var = 1 -class TestDate(HarmlessMixedComparison): +class TestDate(HarmlessMixedComparison, unittest.TestCase): # Tests here should pass for both dates and datetimes, except for a # few tests that TestDateTime overrides. @@ -1596,7 +1596,7 @@ class SubclassTime(time): sub_var = 1 -class TestTime(HarmlessMixedComparison): +class TestTime(HarmlessMixedComparison, unittest.TestCase): theclass = time @@ -1879,7 +1879,7 @@ # A mixin for classes with a tzinfo= argument. Subclasses must define # theclass as a class atribute, and theclass(1, 1, 1, tzinfo=whatever) # must be legit (which is true for time and datetime). -class TZInfoBase(unittest.TestCase): +class TZInfoBase: def test_argument_passing(self): cls = self.theclass @@ -2039,7 +2039,7 @@ # Testing time objects with a non-None tzinfo. -class TestTimeTZ(TestTime, TZInfoBase): +class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase): theclass = time def test_empty(self): @@ -2287,7 +2287,7 @@ # Testing datetime objects with a non-None tzinfo. -class TestDateTimeTZ(TestDateTime, TZInfoBase): +class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase): theclass = datetime def test_trivial(self): @@ -3248,31 +3248,13 @@ self.assertEqual(as_datetime, datetime_sc) self.assertEqual(datetime_sc, as_datetime) -def test_suite(): - allsuites = [unittest.makeSuite(klass, 'test') - for klass in (TestModule, - TestTZInfo, - TestTimeDelta, - TestDateOnly, - TestDate, - TestDateTime, - TestTime, - TestTimeTZ, - TestDateTimeTZ, - TestTimezoneConversions, - Oddballs, - ) - ] - return unittest.TestSuite(allsuites)
def test_main(): import gc import sys
- thesuite = test_suite() lastrc = None while True:
test_support.run_suite(thesuite)
test_support.run_unittest(__name__) if 1: # change to 0, under a debug build, for some leak detection break gc.collect()
Modified: python/trunk/Lib/test/test_email.py
--- python/trunk/Lib/test/test_email.py (original) +++ python/trunk/Lib/test/test_email.py Wed Apr 25 19:29:52 2007 @@ -4,10 +4,10 @@ import unittest
The specific tests now live in Lib/email/test
from email.test.test_email import suite -from test.test_support import run_suite +from test import test_support
def test_main():
- run_suite(suite())
- test_support.run_unittest(suite())
if name == 'main': test_main()
Modified: python/trunk/Lib/test/test_email_codecs.py
--- python/trunk/Lib/test/test_email_codecs.py (original) +++ python/trunk/Lib/test/test_email_codecs.py Wed Apr 25 19:29:52 2007 @@ -9,7 +9,7 @@ def test_main(): suite = test_email_codecs.suite() suite.addTest(test_email_codecs_renamed.suite())
- test_support.run_suite(suite)
- test_support.run_unittest(suite)
if name == 'main': test_main()
Modified: python/trunk/Lib/test/test_email_renamed.py
--- python/trunk/Lib/test/test_email_renamed.py (original) +++ python/trunk/Lib/test/test_email_renamed.py Wed Apr 25 19:29:52 2007 @@ -4,10 +4,10 @@ import unittest
The specific tests now live in Lib/email/test
from email.test.test_email_renamed import suite -from test.test_support import run_suite +from test import test_support
def test_main():
- run_suite(suite())
- test_support.run_unittest(suite())
if name == 'main': test_main()
Modified: python/trunk/Lib/test/test_gettext.py
--- python/trunk/Lib/test/test_gettext.py (original) +++ python/trunk/Lib/test/test_gettext.py Wed Apr 25 19:29:52 2007 @@ -4,7 +4,7 @@ import gettext import unittest -from test.test_support import run_suite +from test import test_support # TODO: @@ -336,19 +336,8 @@ 'John Doe <jdoe at example.com>\nJane Foobar <jfoobar at example.com>') -def suite(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(GettextTestCase1)) - suite.addTest(unittest.makeSuite(GettextTestCase2)) - suite.addTest(unittest.makeSuite(PluralFormsTestCase)) - suite.addTest(unittest.makeSuite(UnicodeTranslationsTest)) - suite.addTest(unittest.makeSuite(WeirdMetadataTest)) - return suite
- def test_main():
- run_suite(suite())
- test_support.run_unittest(name)
if name == 'main': test_main()
Modified: python/trunk/Lib/test/test_multibytecodec.py
--- python/trunk/Lib/test/test_multibytecodec.py (original) +++ python/trunk/Lib/test/test_multibytecodec.py Wed Apr 25 19:29:52 2007 @@ -219,13 +219,7 @@ myunichr(x).encode('iso_2022_jp', 'ignore')
def test_main():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(Test_MultibyteCodec))
- suite.addTest(unittest.makeSuite(Test_IncrementalEncoder))
- suite.addTest(unittest.makeSuite(Test_IncrementalDecoder))
- suite.addTest(unittest.makeSuite(Test_StreamWriter))
- suite.addTest(unittest.makeSuite(Test_ISO2022))
- test_support.run_suite(suite)
- test_support.run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_optparse.py
--- python/trunk/Lib/test/test_optparse.py (original) +++ python/trunk/Lib/test/test_optparse.py Wed Apr 25 19:29:52 2007 @@ -1631,18 +1631,8 @@ "option -l: invalid long integer value: '0x12x'") -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())
- test_support.run_unittest(name)
if name == 'main':
- unittest.main()
- test_main()
Modified: python/trunk/Lib/test/test_robotparser.py
--- python/trunk/Lib/test/test_robotparser.py (original) +++ python/trunk/Lib/test/test_robotparser.py Wed Apr 25 19:29:52 2007 @@ -135,8 +135,8 @@ RobotTest(7, doc, good, bad)
def test_main():
- test_support.run_suite(tests)
- test_support.run_unittest(tests)
if name=='main': test_support.Verbose = 1
- test_support.run_suite(tests)
- test_main()
Modified: python/trunk/Lib/test/test_support.py
--- python/trunk/Lib/test/test_support.py (original) +++ python/trunk/Lib/test/test_support.py Wed Apr 25 19:29:52 2007 @@ -8,6 +8,7 @@ import socket import sys import warnings +import types
class Error(Exception): """Base class for regression test exceptions.""" @@ -519,7 +520,7 @@ return result
-def run_suite(suite, testclass=None): +def _run_suite(suite): """Run tests from a unittest.TestSuite-derived class.""" if verbose: runner = unittest.TextTestRunner(sys.stdout, verbosity=2) @@ -533,28 +534,26 @@ elif len(result.failures) == 1 and not result.errors: err = result.failures[0][1] else:
if testclass is None:
msg = "errors occurred; run in verbose mode for details"
else:
msg = "errors occurred in %s.%s" \
% (testclass.__module__, testclass.__name__)
msg = "errors occurred; run in verbose mode for details" raise TestFailed(msg) raise TestFailed(err)
def run_unittest(*classes): """Run tests from unittest.TestCase-derived classes."""
- valid_types = (unittest.TestSuite, unittest.TestCase) suite = unittest.TestSuite() for cls in classes:
if isinstance(cls, (unittest.TestSuite, unittest.TestCase)):
if isinstance(cls, str):
if cls in sys.modules:
suite.addTest(unittest.findTestCases(sys.modules[cls]))
else:
raise ValueError("str arguments must be keys in sys.modules")
elif isinstance(cls, valid_types): suite.addTest(cls) else: suite.addTest(unittest.makeSuite(cls))
- if len(classes)==1:
testclass = classes[0]
- else:
testclass = None
- run_suite(suite, testclass)
- _run_suite(suite)
#=======================================================================
Modified: python/trunk/Lib/test/test_threading_local.py
--- python/trunk/Lib/test/test_threading_local.py (original) +++ python/trunk/Lib/test/test_threading_local.py Wed Apr 25 19:29:52 2007 @@ -20,7 +20,7 @@ setUp=setUp, tearDown=tearDown) )
- test_support.run_suite(suite)
- test_support.run_unittest(suite)
if name == 'main': test_main()
Modified: python/trunk/Lib/test/test_unicode.py
--- python/trunk/Lib/test/test_unicode.py (original) +++ python/trunk/Lib/test/test_unicode.py Wed Apr 25 19:29:52 2007 @@ -822,7 +822,7 @@
def test_main():
- test_support.run_unittest(UnicodeTest)
- test_support.run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_unicode_file.py
--- python/trunk/Lib/test/test_unicode_file.py (original) +++ python/trunk/Lib/test/test_unicode_file.py Wed Apr 25 19:29:52 2007 @@ -5,7 +5,7 @@ import unicodedata
import unittest -from test.test_support import run_suite, TestSkipped, TESTFN_UNICODE +from test.test_support import run_unittest, TestSkipped, TESTFN_UNICODE from test.test_support import TESTFN_ENCODING, TESTFN_UNICODE_UNENCODEABLE try: TESTFN_ENCODED = TESTFN_UNICODE.encode(TESTFN_ENCODING) @@ -205,9 +205,7 @@ False)
def test_main():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(TestUnicodeFiles))
- run_suite(suite)
- run_unittest(name)
if name == "main": test_main()
Modified: python/trunk/Lib/test/test_wsgiref.py
--- python/trunk/Lib/test/test_wsgiref.py (original) +++ python/trunk/Lib/test/test_wsgiref.py Wed Apr 25 19:29:52 2007 @@ -1,5 +1,5 @@ from future import nested_scopes # Backward compat for 2.1 -from unittest import TestSuite, TestCase, makeSuite +from unittest import TestCase from wsgiref.util import setup_testing_defaults from wsgiref.headers import Headers from wsgiref.handlers import BaseHandler, BaseCGIHandler @@ -11,6 +11,7 @@ from SocketServer import BaseServer import re, sys
+from test import test_support
class MockServer(WSGIServer): """Non-socket HTTP server""" @@ -575,11 +576,7 @@
This epilogue is needed for compatibility with the Python 2.5 regrtest module
def test_main():
- import unittest
- from test.test_support import run_suite
- run_suite(
unittest.defaultTestLoader.loadTestsFromModule(sys.modules[__name__])
- )
- test_support.run_unittest(name)
if name == "main": test_main()
- Previous message: [Python-checkins] r54955 - peps/trunk/pep-3119.txt
- Next message: [Python-checkins] r54957 - python/trunk/Lib/test/test_datetime.py
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]