summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-05-25 11:03:24 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-05-25 11:03:24 -0400
commitf0d6f1b9f755faf879d980bb1ffc59e66823558b (patch)
tree95320e2d092821ec919c3022d685a7e966dea4e9
parentc41e8840131497db54edcaa43931c05bfc973196 (diff)
downloadpython-coveragepy-git-nedbat/bug1160.tar.gz
wip: test demonstrating the problemnedbat/bug1160
-rw-r--r--tests/test_html.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_html.py b/tests/test_html.py
index c9dbacc8..b414ca9d 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -336,6 +336,16 @@ class HtmlWithUnparsableFilesTest(HtmlTestHelpers, CoverageTest):
with pytest.raises(NotPython, match=msg):
cov.html_report()
+ def test_dotpy_is_binary(self):
+ self.make_file("main.py", "import innocuous")
+ self.make_file("innocuous.py", "a = 1")
+ cov = coverage.Coverage()
+ self.start_import_stop(cov, "main")
+ self.make_file("innocuous.py", bytes=b"\x99\x01\xff\xee\xdd\xcc\xbb")
+ msg = "Couldn't parse '.*innocuous.py' as Python source: .* at line 1"
+ with pytest.raises(NotPython, match=msg):
+ cov.html_report()
+
def test_dotpy_not_python_ignored(self):
self.make_file("main.py", "import innocuous")
self.make_file("innocuous.py", "a = 2")