diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-09-08 08:09:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-08 17:09:55 +0200 |
| commit | 7538fe34d730fe08cbbecc17606bc0f5f69ff416 (patch) | |
| tree | 2e2e8a40452a6ac9e48cbf7f173d514fa5443694 /Lib/test/libregrtest/main.py | |
| parent | 462c1f0403324efc27c11435da12b8d16f5387de (diff) | |
| download | cpython-git-7538fe34d730fe08cbbecc17606bc0f5f69ff416.tar.gz | |
bpo-45118: Fix regrtest second summary for re-run tests (GH-28183) (GH-28214)
Fix regrtest second summary when using -w/--verbose2 command line
option: lists re-run tests in the second test summary.
(cherry picked from commit c4ea45d7d2c02674db2fdb96c7eee89324d2dc64)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Lib/test/libregrtest/main.py')
| -rw-r--r-- | Lib/test/libregrtest/main.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 4dcb639920..52cc065da1 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -66,6 +66,7 @@ class Regrtest: self.resource_denieds = [] self.environment_changed = [] self.run_no_tests = [] + self.need_rerun = [] self.rerun = [] self.first_result = None self.interrupted = False @@ -116,7 +117,7 @@ class Regrtest: 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): @@ -312,10 +313,12 @@ class Regrtest: 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] @@ -397,7 +400,7 @@ class Regrtest: 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() |
