From cdd594ecfedace59a42bc6fa0debe4105ada0da6 Mon Sep 17 00:00:00 2001 From: Adrien Di Mascio Date: Tue, 8 Jul 2008 10:29:16 +0200 Subject: patch unittest's TestSuite class directly to be compatible with suites using unittest.TestSuite explicitly --- testlib.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'testlib.py') diff --git a/testlib.py b/testlib.py index a341ef1..57d600d 100644 --- a/testlib.py +++ b/testlib.py @@ -429,17 +429,18 @@ class SkipAwareTestResult(unittest._TextTestResult): -class TestSuite(unittest.TestSuite): - def run(self, result, runcondition=None, options=None): - for test in self._tests: - if result.shouldStop: - break - test(result, runcondition, options) - return result +def run(self, result, runcondition=None, options=None): + for test in self._tests: + if result.shouldStop: + break + test(result, runcondition, options) + return result +unittest.TestSuite.run = run - # python2.3 compat - def __call__(self, *args, **kwds): - return self.run(*args, **kwds) +# python2.3 compat +def __call__(self, *args, **kwds): + return self.run(*args, **kwds) +unittest.TestSuite.__call__ = __call__ class SkipAwareTextTestRunner(unittest.TextTestRunner): @@ -561,7 +562,6 @@ class NonStrictTestLoader(unittest.TestLoader): python test_foo.py test_foo1 will run test_foo1 python test_foo.py test_bar will run FooTC.test_bar1 and BarTC.test_bar2 """ - suiteClass = TestSuite def __init__(self): self.skipped_patterns = [] -- cgit v1.2.1