coverage.py: actually count number of successes to print the correct number when ctrl+c was pressed
This commit is contained in:
parent
5ea760920d
commit
7198ad50f6
1 changed files with 3 additions and 1 deletions
|
@ -175,6 +175,7 @@ def main():
|
||||||
starttime = time.time()
|
starttime = time.time()
|
||||||
skipped = defaultdict(list)
|
skipped = defaultdict(list)
|
||||||
failed = []
|
failed = []
|
||||||
|
num_success = 0
|
||||||
for i, (test, name, dist, mode, variant, fmt) in enumerate(tests):
|
for i, (test, name, dist, mode, variant, fmt) in enumerate(tests):
|
||||||
print(separator, file=sys.stderr)
|
print(separator, file=sys.stderr)
|
||||||
print("(%d/%d) %s" % (i + 1, len(tests), name), 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)
|
print("result: FAILURE", file=sys.stderr)
|
||||||
else:
|
else:
|
||||||
print("result: SUCCESS", file=sys.stderr)
|
print("result: SUCCESS", file=sys.stderr)
|
||||||
|
num_success += 1
|
||||||
if args.maxfail and len(failed) >= args.maxfail:
|
if args.maxfail and len(failed) >= args.maxfail:
|
||||||
break
|
break
|
||||||
print(
|
print(
|
||||||
"successfully ran %d tests" % (len(tests) - len(skipped) - len(failed)),
|
"successfully ran %d tests" % num_success,
|
||||||
file=sys.stderr,
|
file=sys.stderr,
|
||||||
)
|
)
|
||||||
if skipped:
|
if skipped:
|
||||||
|
|
Loading…
Reference in a new issue