Allow partial test runs (#2076)

Signed-off-by: Till Faelligen <tfaelligen@gmail.com>
This commit is contained in:
S7evinK 2021-12-20 11:26:23 +01:00 committed by GitHub
parent e5a5be9f54
commit 640ba425e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -178,6 +178,10 @@ def print_stats(header_name, gid_to_tests, gid_to_name, verbose):
subsections.append(line) subsections.append(line)
subsection_test_names[line] = test_names_and_marks subsection_test_names[line] = test_names_and_marks
# avoid errors when trying to divide by 0
if total_tests == 0:
return
pct = "{0:.0f}%".format(total_passing/total_tests * 100) pct = "{0:.0f}%".format(total_passing/total_tests * 100)
print("%s: %s (%d/%d tests)" % (header_name, pct, total_passing, total_tests)) print("%s: %s (%d/%d tests)" % (header_name, pct, total_passing, total_tests))
print("-" * (len(header_name)+1)) print("-" * (len(header_name)+1))