summaryrefslogtreecommitdiff
path: root/test/testbase.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/testbase.py')
-rw-r--r--test/testbase.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/testbase.py b/test/testbase.py
index b4fbb3142..3b16d3105 100644
--- a/test/testbase.py
+++ b/test/testbase.py
@@ -88,7 +88,19 @@ class TTestSuite(unittest.TestSuite):
self._initTest = None
unittest.TestSuite.__init__(self, tests)
+ def do_run(self, result):
+ """nice job unittest ! you switched __call__ and run() between py2.3 and 2.4 thereby
+ making straight subclassing impossible !"""
+ for test in self._tests:
+ if result.shouldStop:
+ break
+ test(result)
+ return result
+
def run(self, result):
+ return self(result)
+
+ def __call__(self, result):
try:
if self._initTest is not None:
self._initTest.setUpAll()
@@ -96,7 +108,7 @@ class TTestSuite(unittest.TestSuite):
result.addError(self._initTest, self.__exc_info())
pass
try:
- return unittest.TestSuite.run(self, result)
+ return self.do_run(result)
finally:
try:
if self._initTest is not None:
@@ -116,7 +128,6 @@ class TTestSuite(unittest.TestSuite):
return (exctype, excvalue, tb)
return (exctype, excvalue, tb)
-
unittest.TestLoader.suiteClass = TTestSuite
def runTests(suite):
@@ -124,4 +135,4 @@ def runTests(suite):
runner.run(suite)
def main():
- unittest.main() \ No newline at end of file
+ unittest.main()