diff options
author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> | 2008-07-08 10:29:16 +0200 |
---|---|---|
committer | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> | 2008-07-08 10:29:16 +0200 |
commit | cdd594ecfedace59a42bc6fa0debe4105ada0da6 (patch) | |
tree | 1c653dc1d91cd3b7750746ddb2a61a57862aa05d | |
parent | 5f33942991d24e2288e384b7959bc66d1b6e31f0 (diff) | |
download | logilab-common-cdd594ecfedace59a42bc6fa0debe4105ada0da6.tar.gz |
patch unittest's TestSuite class directly to be compatible with suites using unittest.TestSuite explicitly
-rw-r--r-- | testlib.py | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -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 = [] |