diff options
author | Steve Purcell <steve@pythonconsulting.com> | 2001-03-22 08:45:36 (GMT) |
---|---|---|
committer | Steve Purcell <steve@pythonconsulting.com> | 2001-03-22 08:45:36 (GMT) |
commit | 5ddd1a8dcb260eb8c25d7d27f7623f020648ad70 (patch) | |
tree | 304eb67a092f226980deaeb6c7b2351bed1e97ec /Lib/test | |
parent | 2e2cded1b56cc5488f49d395b46131fd995b02bc (diff) | |
download | cpython-5ddd1a8dcb260eb8c25d7d27f7623f020648ad70.zip cpython-5ddd1a8dcb260eb8c25d7d27f7623f020648ad70.tar.gz cpython-5ddd1a8dcb260eb8c25d7d27f7623f020648ad70.tar.bz2 |
Updated to latest PyUnit version (1.31 in PyUnit CVS); test_support.py
changed accordingly.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_support.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index ba34ac8..426f7aa 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -102,12 +102,9 @@ def check_syntax(statement): import unittest -class BasicTestRunner(unittest.VerboseTextTestRunner): - def __init__(self, stream=sys.stderr): - unittest.VerboseTextTestRunner.__init__(self, stream, descriptions=0) - +class BasicTestRunner: def run(self, test): - result = unittest._VerboseTextTestResult(self.stream, descriptions=0) + result = unittest.TestResult() test(result) return result @@ -115,13 +112,12 @@ class BasicTestRunner(unittest.VerboseTextTestRunner): def run_unittest(testclass): """Run tests from a unittest.TestCase-derived class.""" if verbose: - f = sys.stdout + runner = unittest.TextTestRunner(sys.stdout, descriptions=0) else: - import StringIO - f = StringIO.StringIO() + runner = BasicTestRunner() suite = unittest.makeSuite(testclass) - result = BasicTestRunner(stream=f).run(suite) - if result.errors or result.failures: + result = runner.run(suite) + if not result.wasSuccessful(): raise TestFailed("errors occurred in %s.%s" % (testclass.__module__, testclass.__name__)) |