# HG changeset patch # User Gregory Szorc # Date 1398107755 25200 # Node ID 8a4ef661f08d1efc0f5358e06f6f3b5ceebf0ae6 # Parent a46a91989d57b9919f333ed026500cf6ab010d0d run-tests: make failure reporting in unittest mode equivalent to default Unlike unittest's defaults, our result formatter does not print stack traces. Here, we change TestResult.addFailure() to be compatible with the existing/default execution mode. diff -r a46a91989d57 -r 8a4ef661f08d tests/run-tests.py --- a/tests/run-tests.py Sun Apr 20 16:54:51 2014 -0700 +++ b/tests/run-tests.py Mon Apr 21 12:15:55 2014 -0700 @@ -1067,8 +1067,8 @@ # sense to map it into fail some day. self.warned = [] - def addFailure(self, *args, **kwargs): - super(TestResult, self).addFailure(*args, **kwargs) + def addFailure(self, test, reason): + self.failures.append((test, reason)) if self._options.first: self.stop() @@ -1472,8 +1472,12 @@ result.addIgnore(self, str(e)) except WarnTest, e: result.addWarn(self, str(e)) - except self.failureException: - result.addFailure(self, sys.exc_info()) + except self.failureException, e: + # This differs from unittest in that we don't capture + # the stack trace. This is for historical reasons and + # this decision could be revisted in the future, + # especially for PythonTest instances. + result.addFailure(self, str(e)) except Exception: result.addError(self, sys.exc_info()) else: