Mercurial > hg
changeset 21522:eeaec308ad5f
run-tests: raise WarnTest outside of Test.fail()
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 22 Apr 2014 13:25:17 -0700 |
parents | 855f092c96e5 |
children | 9fb6f328576a |
files | tests/run-tests.py |
diffstat | 1 files changed, 5 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/run-tests.py Tue Apr 22 13:16:34 2014 -0700 +++ b/tests/run-tests.py Tue Apr 22 13:25:17 2014 -0700 @@ -526,6 +526,8 @@ raise SkipTest(missing[-1]) elif ret == 'timeout': self.fail('timed out', ret) + elif ret is False: + raise WarnTest('no result code from test') elif out != self._refout: # The result object handles diff calculation for us. self._result.addOutputMismatch(self, out, self._refout) @@ -644,7 +646,6 @@ hgrc.close() def fail(self, msg, ret): - warned = ret is False if (not ret and self._interactive and os.path.exists(self.errpath)): iolock.acquire() @@ -659,12 +660,9 @@ return '.', self.name, '' - if warned: - raise WarnTest(msg) - else: - # unittest differentiates between errored and failed. - # Failed is denoted by AssertionError (by default at least). - raise AssertionError(msg) + # unittest differentiates between errored and failed. + # Failed is denoted by AssertionError (by default at least). + raise AssertionError(msg) class PythonTest(Test): """A Python-based test."""