]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #24751: When running regrtest with '-w', don't fail if re-run succeeds.
authorZachary Ware <zachary.ware@gmail.com>
Wed, 5 Aug 2015 02:53:21 +0000 (21:53 -0500)
committerZachary Ware <zachary.ware@gmail.com>
Wed, 5 Aug 2015 02:53:21 +0000 (21:53 -0500)
Lib/test/regrtest.py
Misc/NEWS

index 2458a3d1a0cb81ced85c0bea517f94e419a67a31..eaf39bb8a674565dbb9596ae1534390f8dbee437 100755 (executable)
@@ -652,7 +652,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
 
     if 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:
@@ -662,8 +662,13 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
                 # 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 single:
         if next_single_test:
index 09db1d3ec5b84c724d6d4cc38930d9c7f488d8f8..76e02269777b6b66de77faecdcec599e6f4e283d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -149,6 +149,13 @@ Documentation
 - Issue #22155: Add File Handlers subsection with createfilehandler to Tkinter
   doc.  Remove obsolete example from FAQ.  Patch by Martin Panter.
 
+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.
+
 
 What's New in Python 2.7.10?
 ============================