summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_html.py11
-rw-r--r--tests/test_parser.py6
2 files changed, 8 insertions, 9 deletions
diff --git a/tests/test_html.py b/tests/test_html.py
index 6f6f42e4..a5878448 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -6,7 +6,6 @@ import os.path
import re
import coverage
-from coverage import env
import coverage.html
from coverage.misc import CoverageException, NotPython, NoSource
@@ -297,9 +296,8 @@ class HtmlWithUnparsableFilesTest(HtmlTestHelpers, CoverageTest):
cov.html_report()
self.assert_exists("htmlcov/index.html")
- # TODO: enable this test, and then fix this:
- # https://bitbucket.org/ned/coveragepy/issue/351/files-with-incorrect-encoding-are-ignored
- def SKIP_THIS_decode_error(self):
+ def test_decode_error(self):
+ # https://bitbucket.org/ned/coveragepy/issue/351/files-with-incorrect-encoding-are-ignored
# imp.load_module won't load a file with an undecodable character
# in a comment, though Python will run them. So we'll change the
# file after running.
@@ -324,10 +322,7 @@ class HtmlWithUnparsableFilesTest(HtmlTestHelpers, CoverageTest):
cov.html_report()
html_report = self.get_html_report_content("sub/not_ascii.py")
- if env.PY2:
- expected = "# Isn't this great?�!"
- else:
- expected = "# Isn't this great?Ë!"
+ expected = "# Isn't this great?�!"
self.assertIn(expected, html_report)
def test_formfeeds(self):
diff --git a/tests/test_parser.py b/tests/test_parser.py
index 9359c408..2cf39baa 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -142,7 +142,11 @@ class ParserFileTest(CoverageTest):
fname = fname + ".py"
self.make_file(fname, text, newline=newline)
parser = self.parse_file(fname)
- self.assertEqual(parser.exit_counts(), counts)
+ self.assertEqual(
+ parser.exit_counts(),
+ counts,
+ "Wrong for %r" % fname
+ )
def test_encoding(self):
self.make_file("encoded.py", """\