[Python-checkins] cpython (3.4): Issue #24751: When running regrtest with '-w', don't fail if re-run succeeds.

zach.ware python-checkins at python.org
Wed Aug 5 05:00:19 CEST 2015


https://hg.python.org/cpython/rev/9964edf2fd1e
changeset:   97258:9964edf2fd1e
branch:      3.4
parent:      97251:33dfbb293892
user:        Zachary Ware <zachary.ware at gmail.com>
date:        Tue Aug 04 21:54:54 2015 -0500
summary:
  Issue #24751: When running regrtest with '-w', don't fail if re-run succeeds.

files:
  Lib/test/regrtest.py |  11 ++++++++---
  Misc/NEWS            |   4 ++++
  2 files changed, 12 insertions(+), 3 deletions(-)


diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -812,7 +812,7 @@
 
     if ns.verbose2 and bad:
         print("Re-running failed tests in verbose mode")
-        for test in bad:
+        for test in bad[:]:
             print("Re-running test %r in verbose mode" % test)
             sys.stdout.flush()
             try:
@@ -823,8 +823,13 @@
                 # print a newline separate from the ^C
                 print()
                 break
-            except:
-                raise
+            else:
+                if ok[0] in {PASSED, ENV_CHANGED, SKIPPED, RESOURCE_DENIED}:
+                    bad.remove(test)
+        else:
+            if bad:
+                print(count(len(bad), 'test'), "failed again:")
+                printlist(bad)
 
     if ns.single:
         if next_single_test:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -380,6 +380,10 @@
 Tests
 -----
 
+- Issue #24751: When running regrtest with the ``-w`` command line option,
+  a test run is no longer marked as a failure if all tests succeed when
+  re-run.
+
 - Issue #21520: test_zipfile no longer fails if the word 'bad' appears
   anywhere in the name of the current directory.
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list