diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-05-25 11:03:24 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-05-25 11:03:24 -0400 |
commit | f0d6f1b9f755faf879d980bb1ffc59e66823558b (patch) | |
tree | 95320e2d092821ec919c3022d685a7e966dea4e9 /tests/test_html.py | |
parent | c41e8840131497db54edcaa43931c05bfc973196 (diff) | |
download | python-coveragepy-git-nedbat/bug1160.tar.gz |
wip: test demonstrating the problemnedbat/bug1160
Diffstat (limited to 'tests/test_html.py')
-rw-r--r-- | tests/test_html.py | 10 |
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") |