diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-06-16 14:59:48 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-06-16 14:59:48 -0400 |
commit | 01d491ea56ad2d588898ee2ab70b99731f1b26c1 (patch) | |
tree | e50a61aff35b33f3e87dc8e40798f92be5268969 /tests | |
parent | 05e2907441ef6aed39feaf2355a02ef735f6cede (diff) | |
download | python-coveragepy-git-01d491ea56ad2d588898ee2ab70b99731f1b26c1.tar.gz |
Add more contracts
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_phystokens.py | 9 |
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)), |