summaryrefslogtreecommitdiff
path: root/tests/test_html.py
diff options
context:
space:
mode:
authorloic@dachary.org <loic@dachary.org>2017-01-11 00:45:04 +0100
committerloic@dachary.org <loic@dachary.org>2017-01-11 00:45:04 +0100
commite7faaa5a1e2e316ec7ec215946a291711f397a32 (patch)
tree539b21c7541ba6653b42b4f66ef410f9056a6654 /tests/test_html.py
parentf0337bcc49ebd1664ea967bca9044af501a45e7c (diff)
downloadpython-coveragepy-git-e7faaa5a1e2e316ec7ec215946a291711f397a32.tar.gz
html total must account for files 100% covered #549
The --skip-covered implementation for html must not just skip the files that are 100% covered. It must remember them and not fail with a "no coverage data" when all files are 100% covered. The statistics about the files that are 100% covered must also be summed in the total for the index.html page. close #549 --HG-- branch : issue-549
Diffstat (limited to 'tests/test_html.py')
-rw-r--r--tests/test_html.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test_html.py b/tests/test_html.py
index 1c9fa434..06d59460 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -47,7 +47,7 @@ class HtmlTestHelpers(CoverageTest):
self.clean_local_file_imports()
cov = coverage.Coverage(**(covargs or {}))
self.start_import_stop(cov, "main_file")
- cov.html_report(**(htmlargs or {}))
+ return cov.html_report(**(htmlargs or {}))
def remove_html_files(self):
"""Remove the HTML files created as part of the HTML report."""
@@ -464,6 +464,15 @@ class HtmlTest(HtmlTestHelpers, CoverageTest):
self.assert_doesnt_exist("htmlcov/main_file_py.html")
self.assert_exists("htmlcov/not_covered_py.html")
+ def test_report_skip_covered_100(self):
+ self.make_file("main_file.py", """
+ def normal():
+ print("z")
+ normal()
+ """)
+ assert self.run_coverage(covargs=dict(source="."), htmlargs=dict(skip_covered=True)) == 100.0
+ self.assert_doesnt_exist("htmlcov/main_file_py.html")
+
def test_report_skip_covered_branches(self):
self.make_file("main_file.py", """
import not_covered