]> granicus.if.org Git - python/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:54:54 +0000 (21:54 -0500)
committerZachary Ware <zachary.ware@gmail.com>
Wed, 5 Aug 2015 02:54:54 +0000 (21:54 -0500)
Lib/test/regrtest.py
Misc/NEWS

index 350e6849ee618c8e0f5d402b0e7284837363677d..c97ec52c7a1c6dd309753d2aa53078e756364d95 100755 (executable)
@@ -812,7 +812,7 @@ def main(tests=None, **kwargs):
 
     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 @@ def main(tests=None, **kwargs):
                 # 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:
index e6a539907553b72f8da33ca45068ae97a3824c92..76ad97089d4db6c3a0b2277cfe5541e64064c388 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -380,6 +380,10 @@ IDLE
 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.