comparison tests/run-tests.py @ 21753:b7baef94a333

run-tests: checks behaviour of test on failure while testing On failure while testing, if this function "result.addFailure(self, str(e))" returns true then test get 'passed' else count as 'failed'.
author anuraggoel <anurag.dsps@gmail.com>
date Fri, 13 Jun 2014 14:33:02 +0530
parents 2b3b60031b6f
children 7e14d026c4c4
comparison
equal deleted inserted replaced
21751:c5699c2d690b 21753:b7baef94a333
467 except self.failureException, e: 467 except self.failureException, e:
468 # This differs from unittest in that we don't capture 468 # This differs from unittest in that we don't capture
469 # the stack trace. This is for historical reasons and 469 # the stack trace. This is for historical reasons and
470 # this decision could be revisted in the future, 470 # this decision could be revisted in the future,
471 # especially for PythonTest instances. 471 # especially for PythonTest instances.
472 result.addFailure(self, str(e)) 472 if result.addFailure(self, str(e)):
473 success = True
473 except Exception: 474 except Exception:
474 result.addError(self, sys.exc_info()) 475 result.addError(self, sys.exc_info())
475 else: 476 else:
476 success = True 477 success = True
477 478