Updated to latest PyUnit version (1.31 in PyUnit CVS); test_support.py
changed accordingly.
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 @@
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 @@
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__))