Skip to content
Snippets Groups Projects
Commit f80ea15a authored by Florian Bruhin's avatar Florian Bruhin
Browse files

Fix div by zero with no tests

parent bd0529ae
No related branches found
No related tags found
No related merge requests found
...@@ -146,8 +146,10 @@ class OutcomeSummary(QLabel): ...@@ -146,8 +146,10 @@ class OutcomeSummary(QLabel):
color = utils.OUTCOME_COLORS[outcome] color = utils.OUTCOME_COLORS[outcome]
parts.append(f"<font color='{color.name()}'>{count} {outcome}</font>") parts.append(f"<font color='{color.name()}'>{count} {outcome}</font>")
grade = 5 * summary['passed'] / sum(summary.values()) + 1 total = sum(summary.values())
parts.append(f'{round(grade, 2)}') if total:
grade = 5 * summary['passed'] / total + 1
parts.append(f'{round(grade, 2)}')
self.setText('<br>'.join(parts)) self.setText('<br>'.join(parts))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment