summaryrefslogtreecommitdiff
path: root/tests/test_phystokens.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2014-10-26 10:34:56 -0400
committerNed Batchelder <ned@nedbatchelder.com>2014-10-26 10:34:56 -0400
commit9b8e67fe48ca5d9d1d6e1a7f03eac625388cc7c7 (patch)
tree721cbf5feaa985459a02535bd20a2a98c1ceb479 /tests/test_phystokens.py
parentafc7a3856f9e85d1516822c80deeab0fed41532a (diff)
downloadpython-coveragepy-git-9b8e67fe48ca5d9d1d6e1a7f03eac625388cc7c7.tar.gz
Use with-open everywhere
Diffstat (limited to 'tests/test_phystokens.py')
-rw-r--r--tests/test_phystokens.py4
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)),