diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2017-02-10 06:59:51 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2017-02-10 06:59:51 -0500 |
commit | 5d8d4b634c475b4f5517e18f9bf580574d9a032a (patch) | |
tree | 1a9e5c4c427166e060355574e03b411b1d041047 /tests/test_html.py | |
parent | d6a3ecb65b44d2d82f97f3a00bc099720f4356bb (diff) | |
download | python-coveragepy-git-5d8d4b634c475b4f5517e18f9bf580574d9a032a.tar.gz |
Run two files to be sure we know what error we'll get
Diffstat (limited to 'tests/test_html.py')
-rw-r--r-- | tests/test_html.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_html.py b/tests/test_html.py index 49cf221e..ff9ea3b8 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -295,18 +295,20 @@ class HtmlWithUnparsableFilesTest(HtmlTestHelpers, CoverageTest): """Test the behavior when measuring unparsable files.""" def test_dotpy_not_python(self): + self.make_file("main.py", "import innocuous") self.make_file("innocuous.py", "a = 1") cov = coverage.Coverage() - self.start_import_stop(cov, "innocuous") + self.start_import_stop(cov, "main") self.make_file("innocuous.py", "<h1>This isn't python!</h1>") msg = "Couldn't parse '.*innocuous.py' as Python source: .* at line 1" with self.assertRaisesRegex(NotPython, 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") cov = coverage.Coverage() - self.start_import_stop(cov, "innocuous") + self.start_import_stop(cov, "main") self.make_file("innocuous.py", "<h1>This isn't python!</h1>") cov.html_report(ignore_errors=True) self.assertEqual( |