summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-07-31 22:20:06 -0400
committerNed Batchelder <ned@nedbatchelder.com>2012-07-31 22:20:06 -0400
commit1cac130c6c95804657c62c3944fd299a6690e73a (patch)
tree9974e07fdf4a52523bba420e1f6624776c30252a
parent77a5085b2af747466d06568ad026b6e8495949b3 (diff)
downloadpython-coveragepy-git-1cac130c6c95804657c62c3944fd299a6690e73a.tar.gz
Make the new test also run in Py3
-rw-r--r--test/test_html.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/test_html.py b/test/test_html.py
index 3ebdb10b..36275fa0 100644
--- a/test/test_html.py
+++ b/test/test_html.py
@@ -204,7 +204,10 @@ class HtmlWithUnparsableFilesTest(CoverageTest):
have been raised when writing the HTML report.
"""
- source = "exec compile('', '', 'exec') in {'__file__' : 'liar.html'}"
+ if sys.version_info < (3, 0):
+ source = "exec compile('','','exec') in {'__file__': 'liar.html'}"
+ else:
+ source = "exec(compile('','','exec'), {'__file__': 'liar.html'})"
self.make_file("liar.py", source)
self.make_file("liar.html", "{# Whoops, not python code #}")
cov = coverage.coverage()