Skip to content

Commit

Permalink
Merge pull request #210 from dianakolusheva/zero_tests
Browse files Browse the repository at this point in the history
Fix division by zero
  • Loading branch information
dianakolusheva committed Mar 18, 2021
2 parents a4df66f + 82a0c53 commit a11c891
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion emmaa/analyze_tests_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,10 @@ def get_number_passed_tests(self, mc_type='pysb'):

def passed_over_total(self, mc_type='pysb'):
"""Return a ratio of passed over total tests."""
return self.get_number_passed_tests(mc_type)/self.get_total_applied_tests()
total = self.get_total_applied_tests()
if total == 0:
return 0
return self.get_number_passed_tests(mc_type)/total

def _get_applied_tests_results(self):
"""Return a dictionary mapping a test hash and a list containing its
Expand Down

0 comments on commit a11c891

Please sign in to comment.