Message401151
When running Python with test -w/--verbose2 command line option to re-run tests which failed, the failing tests are listed in the first summary, and they are not listed in the final summary.
Example with Lib/test/test_x.py:
---
import builtins
import unittest
class Tests(unittest.TestCase):
def test_succeed(self):
return
def test_fail_once(self):
if not hasattr(builtins, '_test_failed'):
builtins._test_failed = True
self.fail("bug")
---
Current output when running test_sys (success) and test_x (failed once, then pass):
---
$ ./python -m test test_sys test_x -w
0:00:00 load avg: 0.80 Run tests sequentially
0:00:00 load avg: 0.80 [1/2] test_sys
0:00:01 load avg: 0.80 [2/2] test_x
test test_x failed -- Traceback (most recent call last):
File "/home/vstinner/python/main/Lib/test/test_x.py", line 11, in test_fail_once
self.fail("bug")
^^^^^^^^^^^^^^^^
AssertionError: bug
test_x failed (1 failure)
== Tests result: FAILURE ==
1 test OK.
1 test failed:
test_x
1 re-run test:
test_x
0:00:01 load avg: 0.80
0:00:01 load avg: 0.80 Re-running failed tests in verbose mode
0:00:01 load avg: 0.80 Re-running test_x in verbose mode (matching: test_fail_once)
test_fail_once (test.test_x.Tests) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
== Tests result: FAILURE then SUCCESS ==
All 2 tests OK.
Total duration: 2.0 sec
Tests result: FAILURE then SUCCESS
---
"re-run tests" is missing in the last summary. |
|
Date |
User |
Action |
Args |
2021-09-06 16:28:52 | vstinner | set | recipients:
+ vstinner |
2021-09-06 16:28:52 | vstinner | set | messageid: <1630945732.21.0.656532683711.issue45118@roundup.psfhosted.org> |
2021-09-06 16:28:52 | vstinner | link | issue45118 messages |
2021-09-06 16:28:52 | vstinner | create | |
|