From 7198ad50f6c3b14d2f1f7d73d66b3d882ccda592 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sun, 29 May 2022 09:43:41 +0200 Subject: [PATCH] coverage.py: actually count number of successes to print the correct number when ctrl+c was pressed --- coverage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/coverage.py b/coverage.py index 4a0d3ac..f765ee8 100755 --- a/coverage.py +++ b/coverage.py @@ -175,6 +175,7 @@ def main(): starttime = time.time() skipped = defaultdict(list) failed = [] + num_success = 0 for i, (test, name, dist, mode, variant, fmt) in enumerate(tests): print(separator, file=sys.stderr) print("(%d/%d) %s" % (i + 1, len(tests), name), file=sys.stderr) @@ -228,10 +229,11 @@ def main(): print("result: FAILURE", file=sys.stderr) else: print("result: SUCCESS", file=sys.stderr) + num_success += 1 if args.maxfail and len(failed) >= args.maxfail: break print( - "successfully ran %d tests" % (len(tests) - len(skipped) - len(failed)), + "successfully ran %d tests" % num_success, file=sys.stderr, ) if skipped: