summaryrefslogtreecommitdiff
path: root/tests/test_phystokens.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_phystokens.py')
-rw-r--r--tests/test_phystokens.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/test_phystokens.py b/tests/test_phystokens.py
index 19f813ae..6fa4a441 100644
--- a/tests/test_phystokens.py
+++ b/tests/test_phystokens.py
@@ -6,17 +6,18 @@ import re
from coverage import env
from coverage.phystokens import source_token_lines, source_encoding
from coverage.phystokens import neuter_encoding_declaration
+from coverage.python import get_python_source
from tests.coveragetest import CoverageTest
-SIMPLE = """\
+SIMPLE = u"""\
# yay!
def foo():
say('two = %d' % 2)
"""
-MIXED_WS = """\
+MIXED_WS = u"""\
def hello():
a="Hello world!"
\tb="indented"
@@ -45,9 +46,7 @@ class PhysTokensTest(CoverageTest):
def check_file_tokenization(self, fname):
"""Use the contents of `fname` for `check_tokenization`."""
- with open(fname) as f:
- source = f.read()
- self.check_tokenization(source)
+ self.check_tokenization(get_python_source(fname))
def test_simple(self):
self.assertEqual(list(source_token_lines(SIMPLE)),