diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2014-10-26 10:34:56 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2014-10-26 10:34:56 -0400 |
commit | 9b8e67fe48ca5d9d1d6e1a7f03eac625388cc7c7 (patch) | |
tree | 721cbf5feaa985459a02535bd20a2a98c1ceb479 /tests/test_phystokens.py | |
parent | afc7a3856f9e85d1516822c80deeab0fed41532a (diff) | |
download | python-coveragepy-git-9b8e67fe48ca5d9d1d6e1a7f03eac625388cc7c7.tar.gz |
Use with-open everywhere
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)), |