summaryrefslogtreecommitdiff
path: root/tests/test_html.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2013-12-14 14:10:22 -0500
committerNed Batchelder <ned@nedbatchelder.com>2013-12-14 14:10:22 -0500
commit124e04f9077cc2b76f9eb28e5f8b7c49a26c4452 (patch)
treea2e5e62e6ee905a096d258f68a93f354ee79600e /tests/test_html.py
parent9d3bc371e31128f6d46f2f9709c5ed8eb5357801 (diff)
downloadpython-coveragepy-124e04f9077cc2b76f9eb28e5f8b7c49a26c4452.tar.gz
Remove unused import
Diffstat (limited to 'tests/test_html.py')
-rw-r--r--tests/test_html.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/test_html.py b/tests/test_html.py
index f22fdc2..9c230c0 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Tests that HTML generation is awesome."""
-import os.path, re, sys
+import os.path, re
import coverage
import coverage.html
from coverage.misc import CoverageException, NotPython, NoSource
@@ -248,10 +248,7 @@ class HtmlWithUnparsableFilesTest(CoverageTest):
# Jinja2 sets __file__ to be a non-Python file, and then execs code.
# If that file contains non-Python code, a TokenError shouldn't
# have been raised when writing the HTML report.
- if sys.version_info < (3, 0):
- source = "exec compile('','','exec') in {'__file__': 'liar.html'}"
- else:
- source = "exec(compile('','','exec'), {'__file__': 'liar.html'})"
+ 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()
@@ -263,10 +260,7 @@ class HtmlWithUnparsableFilesTest(CoverageTest):
# Jinja2 sets __file__ to be a non-Python file, and then execs code.
# If that file contains untokenizable code, we shouldn't get an
# exception.
- if sys.version_info < (3, 0):
- source = "exec compile('','','exec') in {'__file__': 'liar.html'}"
- else:
- source = "exec(compile('','','exec'), {'__file__': 'liar.html'})"
+ source = "exec(compile('','','exec'), {'__file__': 'liar.html'})"
self.make_file("liar.py", source)
# Tokenize will raise an IndentationError if it can't dedent.
self.make_file("liar.html", "0\n 2\n 1\n")