8000 [3.9] bpo-45118: Fix regrtest second summary for re-run tests (GH-28183) by miss-islington · Pull Request #28215 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.9] bpo-45118: Fix regrtest second summary for re-run tests (GH-28183) #28215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-45118: Fix regrtest second summary for re-run tests (GH-28183)
Fix regrtest second summary when using -w/--verbose2 command line
option: lists re-run tests in the second test summary.
(cherry picked from commit c4ea45d)

Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
vstinner authored and miss-islington committed Sep 7, 2021
commit 645c5903f0b88888604bc5452f46112b7946a281
11 changes: 7 additions & 4 deletions Lib/test/libregrtest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def __init__(self):
self.resource_denieds = []
self.environment_changed = []
self.run_no_tests = []
self.need_rerun = []
self.rerun = []
self.first_result = None
self.interrupted = False
Expand Down Expand Up @@ -116,7 +117,7 @@ def accumulate_result(self, result, rerun=False):
elif isinstance(result, Failed):
if not rerun:
self.bad.append(test_name)
self.rerun.append(result)
self.need_rerun.append(result)
elif isinstance(result, DidNotRun):
self.run_no_tests.append(test_name)
elif isinstance(result, Interrupted):
Expand Down Expand Up @@ -309,10 +310,12 @@ def rerun_failed_tests(self):

self.log()
self.log("Re-running failed tests in verbose mode")
rerun_list = self.rerun[:]
self.rerun = []
rerun_list = list(self.need_rerun)
self.need_rerun.clear()
for result in rerun_list:
test_name = result.name
self.rerun.append(test_name)

errors = result.errors or []
failures = result.failures or []
error_names = [test_full_name.split(" ")[0] for (test_full_name, *_) in errors]
Expand Down Expand Up @@ -394,7 +397,7 @@ def display_result(self):
if self.rerun:
print()
print("%s:" % count(len(self.rerun), "re-run test"))
printlist(r.name for r in self.rerun)
printlist(self.rerun)

if self.run_no_tests:
print()
Expand Down
0