This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: regrtest no longer lists "re-run tests" in the second summary
Type: Stage: resolved
Components: Tests Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: lukasz.langa, miss-islington, pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2021-09-06 16:28 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 28183 merged vstinner, 2021-09-06 16:32
PR 28214 merged miss-islington, 2021-09-07 16:21
PR 28215 merged miss-islington, 2021-09-07 16:21
Messages (6)
msg401151 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-09-06 16:28
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.
msg401297 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-09-07 16:21
New changeset c4ea45d7d2c02674db2fdb96c7eee89324d2dc64 by Victor Stinner in branch 'main':
bpo-45118: Fix regrtest second summary for re-run tests (GH-28183)
https://github.com/python/cpython/commit/c4ea45d7d2c02674db2fdb96c7eee89324d2dc64
msg401314 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-09-07 17:21
New changeset 04c13c97eecdb66365782dbbf5e93ff5de267a61 by Miss Islington (bot) in branch '3.9':
bpo-45118: Fix regrtest second summary for re-run tests (GH-28183) (GH-28215)
https://github.com/python/cpython/commit/04c13c97eecdb66365782dbbf5e93ff5de267a61
msg401388 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-09-08 15:09
New changeset 7538fe34d730fe08cbbecc17606bc0f5f69ff416 by Miss Islington (bot) in branch '3.10':
bpo-45118: Fix regrtest second summary for re-run tests (GH-28183) (GH-28214)
https://github.com/python/cpython/commit/7538fe34d730fe08cbbecc17606bc0f5f69ff416
msg401389 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-09-08 15:10
Thanks, Victor! ✨ 🍰 ✨
msg403176 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-10-04 19:18
New changeset 6ae97bbf4e6540a8287c47d098cfe703260b5fa2 by Pablo Galindo (Miss Islington (bot)) in branch '3.10':
bpo-45118: Fix regrtest second summary for re-run tests (GH-28183) (GH-28214)
https://github.com/python/cpython/commit/6ae97bbf4e6540a8287c47d098cfe703260b5fa2
History
Date User Action Args
2022-04-11 14:59:49adminsetgithub: 89281
2021-10-04 19:18:44pablogsalsetnosy: + pablogsal
messages: + msg403176
2021-09-08 15:10:23lukasz.langasetstatus: open -> closed
resolution: fixed
messages: + msg401389

stage: patch review -> resolved
2021-09-08 15:09:59lukasz.langasetmessages: + msg401388
2021-09-07 17:21:26lukasz.langasetmessages: + msg401314
2021-09-07 16:21:12miss-islingtonsetpull_requests: + pull_request26640
2021-09-07 16:21:08miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request26639
2021-09-07 16:21:07lukasz.langasetnosy: + lukasz.langa
messages: + msg401297
2021-09-06 16:32:24vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request26612
2021-09-06 16:28:52vstinnercreate