Commits

Bryan Koroleski  committed 7938a67

Caught a division by zero error.

This happened when a user has no tests (a terrible position to be in).

  • Participants
  • Parent commits 0c9b8b6

Comments (0)

Files changed (1)

File django_coverage/utils/coverage_report/html_report.py

         total_excluded += m_vars.excluded_count
         total_stmts += len(m_vars.stmts)
     module_stats = os.linesep.join(module_stats)
-    overall_covered = float(total_executed)/total_stmts*100
+    if total_stmts:
+        overall_covered = float(total_executed)/total_stmts*100
+    else:
+        overall_covered = 0.0
 
     m_names = modules.keys()
     m_names.sort()