From 02e3d4392b25b8c3fff9e7a00c86665d26fe1ba9 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 24 Oct 2009 20:30:15 -0400 Subject: Commonalize the computation of total coverage percentage for a file. --- coverage/html.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'coverage/html.py') diff --git a/coverage/html.py b/coverage/html.py index 9a68b2c1..99b291b4 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -92,11 +92,8 @@ class HtmlReporter(Reporter): n_exc = len(analysis.excluded) n_mis = len(analysis.missing) n_run = n_stm - n_mis - if n_stm > 0: - pc_cov = 100.0 * n_run / n_stm - else: - pc_cov = 100.0 - + pc_cov = analysis.percent_covered() + # These classes determine which lines are highlighted by default. c_run = " run hide" c_exc = " exc" -- cgit v1.2.1