tests/run-tests.py
changeset 21462 8a4ef661f08d
parent 21461 a46a91989d57
child 21463 c908ff887589
equal deleted inserted replaced
21461:a46a91989d57 21462:8a4ef661f08d
  1065         # We have a custom "warned" result that isn't present in any Python
  1065         # We have a custom "warned" result that isn't present in any Python
  1066         # unittest implementation. It is very similar to failed. It may make
  1066         # unittest implementation. It is very similar to failed. It may make
  1067         # sense to map it into fail some day.
  1067         # sense to map it into fail some day.
  1068         self.warned = []
  1068         self.warned = []
  1069 
  1069 
  1070     def addFailure(self, *args, **kwargs):
  1070     def addFailure(self, test, reason):
  1071         super(TestResult, self).addFailure(*args, **kwargs)
  1071         self.failures.append((test, reason))
  1072 
  1072 
  1073         if self._options.first:
  1073         if self._options.first:
  1074             self.stop()
  1074             self.stop()
  1075 
  1075 
  1076     def addError(self, *args, **kwargs):
  1076     def addError(self, *args, **kwargs):
  1470                         result.addSkip(self, str(e))
  1470                         result.addSkip(self, str(e))
  1471                     except IgnoreTest, e:
  1471                     except IgnoreTest, e:
  1472                         result.addIgnore(self, str(e))
  1472                         result.addIgnore(self, str(e))
  1473                     except WarnTest, e:
  1473                     except WarnTest, e:
  1474                         result.addWarn(self, str(e))
  1474                         result.addWarn(self, str(e))
  1475                     except self.failureException:
  1475                     except self.failureException, e:
  1476                         result.addFailure(self, sys.exc_info())
  1476                         # This differs from unittest in that we don't capture
       
  1477                         # the stack trace. This is for historical reasons and
       
  1478                         # this decision could be revisted in the future,
       
  1479                         # especially for PythonTest instances.
       
  1480                         result.addFailure(self, str(e))
  1477                     except Exception:
  1481                     except Exception:
  1478                         result.addError(self, sys.exc_info())
  1482                         result.addError(self, sys.exc_info())
  1479                     else:
  1483                     else:
  1480                         success = True
  1484                         success = True
  1481 
  1485