summaryrefslogtreecommitdiffstats
path: root/Lib/test/libregrtest
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-05-31 22:48:57 (GMT)
committerGitHub <noreply@github.com>2018-05-31 22:48:57 (GMT)
commit9e24930dfdc28e16dabbfd7dd1ead1336b7b0d6c (patch)
treee86abbd5d242e6a3a1a6a980243dd6e511378aec /Lib/test/libregrtest
parent56013218864d5eb81baab4665fcae13400934078 (diff)
downloadcpython-9e24930dfdc28e16dabbfd7dd1ead1336b7b0d6c.zip
cpython-9e24930dfdc28e16dabbfd7dd1ead1336b7b0d6c.tar.gz
cpython-9e24930dfdc28e16dabbfd7dd1ead1336b7b0d6c.tar.bz2
bpo-33718: regrtest keeps filters to re-run fails (GH-7291)
* No longer clear filters, like --match, to re-run failed tests in verbose mode (-w option). * Tests result: always indicate if tests have been interrupted. * Enhance tests summary
Diffstat (limited to 'Lib/test/libregrtest')
-rw-r--r--Lib/test/libregrtest/main.py39
1 files changed, 22 insertions, 17 deletions
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py
index 1ab47bf..f0c1631 100644
--- a/Lib/test/libregrtest/main.py
+++ b/Lib/test/libregrtest/main.py
@@ -282,7 +282,6 @@ class Regrtest:
self.ns.verbose = True
self.ns.failfast = False
self.ns.verbose3 = False
- self.ns.match_tests = None
print()
print("Re-running failed tests in verbose mode")
@@ -313,7 +312,7 @@ class Regrtest:
return
print()
- print("== Tests result ==")
+ print("== Tests result: %s ==" % self.get_tests_result())
if self.interrupted:
print()
@@ -324,11 +323,6 @@ class Regrtest:
print(count(len(omitted), "test"), "omitted:")
printlist(omitted)
- if self.rerun:
- print()
- print(count(len(self.rerun), "test"), "re-run tests:")
- printlist(self.rerun)
-
if self.good and not self.ns.quiet:
print()
if (not self.bad
@@ -361,6 +355,11 @@ class Regrtest:
print(count(len(self.skipped), "test"), "skipped:")
printlist(self.skipped)
+ if self.rerun:
+ print()
+ print("%s:" % count(len(self.rerun), "re-run test"))
+ printlist(self.rerun)
+
def run_tests_sequential(self):
if self.ns.trace:
import trace
@@ -445,6 +444,21 @@ class Regrtest:
% (locale.getpreferredencoding(False),
sys.getfilesystemencoding()))
+ def get_tests_result(self):
+ result = []
+ if self.bad:
+ result.append("FAILURE")
+ elif self.ns.fail_env_changed and self.environment_changed:
+ result.append("ENV CHANGED")
+
+ if self.interrupted:
+ result.append("INTERRUPTED")
+
+ if not result:
+ result.append("SUCCESS")
+
+ return ', '.join(result)
+
def run_tests(self):
# For a partial run, we do not need to clutter the output.
if (self.ns.header
@@ -486,16 +500,7 @@ class Regrtest:
print()
duration = time.monotonic() - self.start_time
print("Total duration: %s" % format_duration(duration))
-
- if self.bad:
- result = "FAILURE"
- elif self.interrupted:
- result = "INTERRUPTED"
- elif self.ns.fail_env_changed and self.environment_changed:
- result = "ENV CHANGED"
- else:
- result = "SUCCESS"
- print("Tests result: %s" % result)
+ print("Tests result: %s" % self.get_tests_result())
if self.ns.runleaks:
os.system("leaks %d" % os.getpid())