Show More
@@ -585,6 +585,8 b' class Test(unittest.TestCase):' | |||||
585 | result.testsRun -= 1 |
|
585 | result.testsRun -= 1 | |
586 | except WarnTest as e: |
|
586 | except WarnTest as e: | |
587 | result.addWarn(self, str(e)) |
|
587 | result.addWarn(self, str(e)) | |
|
588 | except ReportedTest as e: | |||
|
589 | pass | |||
588 | except self.failureException as e: |
|
590 | except self.failureException as e: | |
589 | # This differs from unittest in that we don't capture |
|
591 | # This differs from unittest in that we don't capture | |
590 | # the stack trace. This is for historical reasons and |
|
592 | # the stack trace. This is for historical reasons and | |
@@ -1243,6 +1245,9 b' class IgnoreTest(Exception):' | |||||
1243 | class WarnTest(Exception): |
|
1245 | class WarnTest(Exception): | |
1244 | """Raised to indicate that a test warned.""" |
|
1246 | """Raised to indicate that a test warned.""" | |
1245 |
|
1247 | |||
|
1248 | class ReportedTest(Exception): | |||
|
1249 | """Raised to indicate that a test already reported.""" | |||
|
1250 | ||||
1246 | class TestResult(unittest._TextTestResult): |
|
1251 | class TestResult(unittest._TextTestResult): | |
1247 | """Holds results when executing via unittest.""" |
|
1252 | """Holds results when executing via unittest.""" | |
1248 | # Don't worry too much about accessing the non-public _TextTestResult. |
|
1253 | # Don't worry too much about accessing the non-public _TextTestResult. | |
@@ -1361,6 +1366,7 b' class TestResult(unittest._TextTestResul' | |||||
1361 | self.addFailure( |
|
1366 | self.addFailure( | |
1362 | test, |
|
1367 | test, | |
1363 | 'server failed to start (HGPORT=%s)' % test._startport) |
|
1368 | 'server failed to start (HGPORT=%s)' % test._startport) | |
|
1369 | raise ReportedTest('server failed to start') | |||
1364 | else: |
|
1370 | else: | |
1365 | self.stream.write('\n') |
|
1371 | self.stream.write('\n') | |
1366 | for line in lines: |
|
1372 | for line in lines: |
@@ -209,8 +209,6 b' failure w/ keyword' | |||||
209 |
|
209 | |||
210 | Verify that when a process fails to start we show a useful message |
|
210 | Verify that when a process fails to start we show a useful message | |
211 | ================================================================== |
|
211 | ================================================================== | |
212 | NOTE: there is currently a bug where this shows "2 failed" even though |
|
|||
213 | it's actually the same test being reported for failure twice. |
|
|||
214 |
|
212 | |||
215 | $ cat > test-serve-fail.t <<EOF |
|
213 | $ cat > test-serve-fail.t <<EOF | |
216 |
> $ |
|
214 | > $ echo 'abort: child process failed to start blah' | |
@@ -219,11 +217,8 b" it's actually the same test being report" | |||||
219 |
|
217 | |||
220 |
ERROR: |
|
218 | ERROR: test-serve-fail.t output changed | |
221 | ! |
|
219 | ! | |
222 | ERROR: test-serve-fail.t output changed |
|
|||
223 | ! |
|
|||
224 |
Failed |
|
220 | Failed test-serve-fail.t: server failed to start (HGPORT=*) (glob) | |
225 | Failed test-serve-fail.t: output changed |
|
221 | # Ran 1 tests, 0 skipped, 0 warned, 1 failed. | |
226 | # Ran 1 tests, 0 skipped, 0 warned, 2 failed. |
|
|||
227 |
|
|
222 | python hash seed: * (glob) | |
228 | [1] |
|
223 | [1] | |
229 |
$ rm |
|
224 | $ rm test-serve-fail.t |
General Comments 0
You need to be logged in to leave comments.
Login now