mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
run-tests: implement TestCase.run()
Simply wrapping TestCase.run() is not sufficient for robust results reporting because unittest in Python 2.4 does not know about things like skipped tests and reports them as success or failures instead of skips. We will reimplement TestCase.run() with knowledge and semantics present in modern Python releases.
This commit is contained in:
parent
a0c6a9e1c4
commit
d51445e339
@ -1330,7 +1330,16 @@ class TestRunner(object):
|
||||
def run(self, result):
|
||||
self._result = result
|
||||
|
||||
return super(MercurialTest, self).run(result)
|
||||
try:
|
||||
self.runTest()
|
||||
except KeyboardInterrupt:
|
||||
raise
|
||||
except self.failureException:
|
||||
result.addFailure(self, sys.exc_info())
|
||||
except Exception:
|
||||
result.addError(self, sys.exc_info())
|
||||
else:
|
||||
result.addSuccess(self)
|
||||
|
||||
def runTest(self):
|
||||
code, tname, msg = t.run()
|
||||
|
Loading…
Reference in New Issue
Block a user