summaryrefslogtreecommitdiff
path: root/coverage/html.py
diff options
context:
space:
mode:
authorNed Batchelder <nedbat@gmail.com>2016-12-24 17:05:29 -0500
committerNed Batchelder <nedbat@gmail.com>2016-12-24 17:05:29 -0500
commit5b71841fe7b172115051357d9d237ab8d523c593 (patch)
tree8602e1e7d7876996a41bff93adcdc22dc2444dac /coverage/html.py
parenta020b6d03226f3c1bf2f6e92ce4ae8999b9187ea (diff)
parentc6a957e0e0ae7bdfe8f5425182188799918dd88a (diff)
downloadpython-coveragepy-5b71841fe7b172115051357d9d237ab8d523c593.tar.gz
Merged in dachary/coverage.py/issue-433-2 (pull request #112)
implement --skip-covered for html report #433
Diffstat (limited to 'coverage/html.py')
-rw-r--r--coverage/html.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/coverage/html.py b/coverage/html.py
index 14771dd..22783ef 100644
--- a/coverage/html.py
+++ b/coverage/html.py
@@ -171,6 +171,15 @@ class HtmlReporter(Reporter):
def html_file(self, fr, analysis):
"""Generate an HTML file for one source file."""
+ # Get the numbers for this file.
+ nums = analysis.numbers
+ if self.config.skip_covered:
+ # Don't report on 100% files.
+ no_missing_lines = (nums.n_missing == 0)
+ no_missing_branches = (nums.n_partial_branches == 0)
+ if no_missing_lines and no_missing_branches:
+ return
+
source = fr.source()
# Find out if the file on disk is already correct.
@@ -184,9 +193,6 @@ class HtmlReporter(Reporter):
self.status.set_file_hash(rootname, this_hash)
- # Get the numbers for this file.
- nums = analysis.numbers
-
if self.has_arcs:
missing_branch_arcs = analysis.missing_branch_arcs()
arcs_executed = analysis.arcs_executed()