run-tests: raise WarnTest outside of Test.fail()
authorGregory Szorc <gregory.szorc@gmail.com>
Tue, 22 Apr 2014 13:25:17 -0700
changeset 21522 eeaec308ad5f
parent 21521 855f092c96e5
child 21523 9fb6f328576a
run-tests: raise WarnTest outside of Test.fail()
tests/run-tests.py
--- 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."""