]> granicus.if.org Git - python/commitdiff
Issue #12074: regrtest displays also the current number of failures
authorVictor Stinner <victor.stinner@haypocalc.com>
Mon, 23 May 2011 21:14:05 +0000 (23:14 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Mon, 23 May 2011 21:14:05 +0000 (23:14 +0200)
Lib/test/regrtest.py

index e2e37652cc0be48354787fbeffaa7615c6c59afd..a8726b52465f5bc450c6ad1824ba39fb69635dc3 100755 (executable)
@@ -580,9 +580,11 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
                 if test is None:
                     finished += 1
                     continue
+                accumulate_result(test, result)
                 if not quiet:
-                    print("[{1:{0}}{2}] {3}".format(
-                        test_count_width, test_index, test_count, test))
+                    print("[{1:{0}}{2}/{3}] {4}".format(
+                        test_count_width, test_index, test_count,
+                        len(bad), test))
                 if stdout:
                     print(stdout)
                 if stderr:
@@ -590,7 +592,6 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
                 if result[0] == INTERRUPTED:
                     assert result[1] == 'KeyboardInterrupt'
                     raise KeyboardInterrupt   # What else?
-                accumulate_result(test, result)
                 test_index += 1
         except KeyboardInterrupt:
             interrupted = True
@@ -600,8 +601,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
     else:
         for test_index, test in enumerate(tests, 1):
             if not quiet:
-                print("[{1:{0}}{2}] {3}".format(
-                    test_count_width, test_index, test_count, test))
+                print("[{1:{0}}{2}/{3}] {4}".format(
+                    test_count_width, test_index, test_count, len(bad), test))
                 sys.stdout.flush()
             if trace:
                 # If we're tracing code coverage, then we don't exit with status