summaryrefslogtreecommitdiff
path: root/tests/test_html.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-08-28 14:30:26 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-08-28 14:30:26 -0400
commitdc025f2e9cd0dfe1c39bf8c62eed451ef7cad256 (patch)
treec0befed0296c78b4e9729c4d175185b99a43c682 /tests/test_html.py
parent6c572033ebb6d68655f44a092c6ededfb8c07b74 (diff)
downloadpython-coveragepy-git-dc025f2e9cd0dfe1c39bf8c62eed451ef7cad256.tar.gz
Fix a crash when reporting on an unmeasured file. #403
Diffstat (limited to 'tests/test_html.py')
-rw-r--r--tests/test_html.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_html.py b/tests/test_html.py
index 3f14bbf5..a852cbe9 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -388,6 +388,15 @@ class HtmlTest(HtmlTestHelpers, CoverageTest):
with open("htmlcov/main_file_py.html") as f:
self.assert_correct_timestamp(f.read())
+ def test_reporting_on_unmeasured_file(self):
+ # It should be ok to ask for an HTML report on a file that wasn't even
+ # measured at all. https://bitbucket.org/ned/coveragepy/issues/403
+ self.create_initial_files()
+ self.make_file("other.py", "a = 1\n")
+ self.run_coverage(htmlargs=dict(morfs=['other.py']))
+ self.assert_exists("htmlcov/index.html")
+ self.assert_exists("htmlcov/other_py.html")
+
class HtmlStaticFileTest(CoverageTest):
"""Tests of the static file copying for the HTML report."""