summaryrefslogtreecommitdiff
path: root/tests/test_html.py
diff options
context:
space:
mode:
authorloic <loic@dachary.org>2016-12-19 01:19:54 +0100
committerloic <loic@dachary.org>2016-12-19 01:19:54 +0100
commitc6a957e0e0ae7bdfe8f5425182188799918dd88a (patch)
treef465795bc9c06f7ca0757b9d3a7830f478441da6 /tests/test_html.py
parent73c034283616600e78d82388a3891b5206ba5d39 (diff)
downloadpython-coveragepy-issue-433-2.tar.gz
html report --skip-covered with branches #433issue-433-2
Add a test because the code path is significantly different. Also document --skip-covered with the coverage html command. close #433
Diffstat (limited to 'tests/test_html.py')
-rw-r--r--tests/test_html.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_html.py b/tests/test_html.py
index b981362..bf47301 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -465,6 +465,24 @@ class HtmlTest(HtmlTestHelpers, CoverageTest):
self.assert_doesnt_exist("htmlcov/main_py.html")
self.assert_exists("htmlcov/not_covered_py.html")
+ def test_report_skip_covered_branches(self):
+ self.make_file("main.py", """
+ import not_covered
+
+ def normal():
+ print("z")
+ normal()
+ """)
+ self.make_file("not_covered.py", """
+ def not_covered():
+ print("n")
+ """)
+ self.run_command("coverage run --branch main.py")
+ self.run_command("coverage html --skip-covered")
+ self.assert_exists("htmlcov/index.html")
+ self.assert_doesnt_exist("htmlcov/main_py.html")
+ self.assert_exists("htmlcov/not_covered_py.html")
+
class HtmlStaticFileTest(CoverageTest):
"""Tests of the static file copying for the HTML report."""