diff options
Diffstat (limited to 'tests/test_html.py')
-rw-r--r-- | tests/test_html.py | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/tests/test_html.py b/tests/test_html.py index 59cda0d4..ee2eb575 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -309,20 +309,20 @@ class HtmlTitleTest(HtmlTestHelpers, CoverageTest): self.make_file(".coveragerc", "[html]\ntitle = «ταБЬℓσ» numbers") self.run_coverage() index = self.get_html_index_content() - assert "<title>«ταБЬℓσ»" \ - " numbers" in index - assert "<h1>«ταБЬℓσ»" \ - " numbers" in index + assert "<title>«ταБЬℓσ» numbers" in index + assert "<h1>«ταБЬℓσ» numbers" in index def test_title_set_in_args(self): self.create_initial_files() self.make_file(".coveragerc", "[html]\ntitle = Good title\n") self.run_coverage(htmlargs=dict(title="«ταБЬℓσ» & stüff!")) index = self.get_html_index_content() - assert "<title>«ταБЬℓσ»" \ - " & stüff!</title>" in index - assert "<h1>«ταБЬℓσ»" \ - " & stüff!:" in index + expected = ( + "<title>«ταБЬℓσ» " + + "& stüff!</title>" + ) + assert expected in index + assert "<h1>«ταБЬℓσ» & stüff!:" in index class HtmlWithUnparsableFilesTest(HtmlTestHelpers, CoverageTest): @@ -345,15 +345,11 @@ class HtmlWithUnparsableFilesTest(HtmlTestHelpers, CoverageTest): self.start_import_stop(cov, "main") self.make_file("innocuous.py", "<h1>This isn't python!</h1>") cov.html_report(ignore_errors=True) - assert len(cov._warnings) == \ - 1, \ - "Expected a warning to be thrown when an invalid python file is parsed" - assert "Couldn't parse Python file" in \ - cov._warnings[0], \ - "Warning message should be in 'invalid file' warning" - assert "innocuous.py" in \ - cov._warnings[0], \ - "Filename should be in 'invalid file' warning" + msg = "Expected a warning to be thrown when an invalid python file is parsed" + assert 1 == len(cov._warnings), msg + msg = "Warning message should be in 'invalid file' warning" + assert "Couldn't parse Python file" in cov._warnings[0], msg + assert "innocuous.py" in cov._warnings[0], "Filename should be in 'invalid file' warning" self.assert_exists("htmlcov/index.html") # This would be better as a glob, if the HTML layout changes: self.assert_doesnt_exist("htmlcov/innocuous.html") |