diff options
Diffstat (limited to 'tests/test_phystokens.py')
| -rw-r--r-- | tests/test_phystokens.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_phystokens.py b/tests/test_phystokens.py index 4755c167..c5289553 100644 --- a/tests/test_phystokens.py +++ b/tests/test_phystokens.py @@ -40,7 +40,9 @@ class PhysTokensTest(CoverageTest): def check_file_tokenization(self, fname): """Use the contents of `fname` for `check_tokenization`.""" - self.check_tokenization(open(fname).read()) + with open(fname) as f: + source = f.read() + self.check_tokenization(source) def test_simple(self): self.assertEqual(list(source_token_lines(SIMPLE)), |
