diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-06-08 07:53:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-08 07:53:51 (GMT) |
commit | c45fc7673e23f911639d10d3771ffef7be870c7a (patch) | |
tree | 30072e17119c5c325342e22f06e24c3fa969a6e2 /Lib/test/libregrtest | |
parent | 396ecb9c3e7fb150eace7bfc733d5b9d0263d697 (diff) | |
download | cpython-c45fc7673e23f911639d10d3771ffef7be870c7a.zip cpython-c45fc7673e23f911639d10d3771ffef7be870c7a.tar.gz cpython-c45fc7673e23f911639d10d3771ffef7be870c7a.tar.bz2 |
bpo-33718: regrtest: use "xxx then yyy" result if re-run (GH-7521)
If tests are re-run, use "xxx then yyy" result format (ex: "FAILURE
then SUCCESS") to show that some failing tests have been re-run.
Add also test_regrtest.test_rerun_fail() test.
Diffstat (limited to 'Lib/test/libregrtest')
-rw-r--r-- | Lib/test/libregrtest/main.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 6a818cd..3429b37 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -79,6 +79,7 @@ class Regrtest: self.resource_denieds = [] self.environment_changed = [] self.rerun = [] + self.first_result = None self.interrupted = False # used by --slow @@ -273,6 +274,8 @@ class Regrtest: self.ns.failfast = False self.ns.verbose3 = False + self.first_result = self.get_tests_result() + print() print("Re-running failed tests in verbose mode") self.rerun = self.bad[:] @@ -447,7 +450,10 @@ class Regrtest: if not result: result.append("SUCCESS") - return ', '.join(result) + result = ', '.join(result) + if self.first_result: + result = '%s then %s' % (self.first_result, result) + return result def run_tests(self): # For a partial run, we do not need to clutter the output. |