##// END OF EJS Templates
run-tests: raise WarnTest outside of Test.fail()
Gregory Szorc -
r21522:eeaec308 default
parent child Browse files
Show More
@@ -526,6 +526,8 b' class Test(unittest.TestCase):'
526 raise SkipTest(missing[-1])
526 raise SkipTest(missing[-1])
527 elif ret == 'timeout':
527 elif ret == 'timeout':
528 self.fail('timed out', ret)
528 self.fail('timed out', ret)
529 elif ret is False:
530 raise WarnTest('no result code from test')
529 elif out != self._refout:
531 elif out != self._refout:
530 # The result object handles diff calculation for us.
532 # The result object handles diff calculation for us.
531 self._result.addOutputMismatch(self, out, self._refout)
533 self._result.addOutputMismatch(self, out, self._refout)
@@ -644,7 +646,6 b' class Test(unittest.TestCase):'
644 hgrc.close()
646 hgrc.close()
645
647
646 def fail(self, msg, ret):
648 def fail(self, msg, ret):
647 warned = ret is False
648 if (not ret and self._interactive and
649 if (not ret and self._interactive and
649 os.path.exists(self.errpath)):
650 os.path.exists(self.errpath)):
650 iolock.acquire()
651 iolock.acquire()
@@ -659,12 +660,9 b' class Test(unittest.TestCase):'
659
660
660 return '.', self.name, ''
661 return '.', self.name, ''
661
662
662 if warned:
663 # unittest differentiates between errored and failed.
663 raise WarnTest(msg)
664 # Failed is denoted by AssertionError (by default at least).
664 else:
665 raise AssertionError(msg)
665 # unittest differentiates between errored and failed.
666 # Failed is denoted by AssertionError (by default at least).
667 raise AssertionError(msg)
668
666
669 class PythonTest(Test):
667 class PythonTest(Test):
670 """A Python-based test."""
668 """A Python-based test."""
General Comments 0
You need to be logged in to leave comments. Login now