summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_difflib.py
diff options
context:
space:
mode:
authorPhilip Jenvey <pjenvey@underboss.org>2009-05-28 06:09:08 (GMT)
committerPhilip Jenvey <pjenvey@underboss.org>2009-05-28 06:09:08 (GMT)
commita27c5bd2bd09da1239f038cccf89cbbba32933ab (patch)
tree1f5136ab5dfd243fe2d39f4a21b7353f7750f362 /Lib/test/test_difflib.py
parent3d2dc35a2847ce89aee31889253fb52b7c5e26a0 (diff)
downloadcpython-a27c5bd2bd09da1239f038cccf89cbbba32933ab.zip
cpython-a27c5bd2bd09da1239f038cccf89cbbba32933ab.tar.gz
cpython-a27c5bd2bd09da1239f038cccf89cbbba32933ab.tar.bz2
Merged revisions 72979 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72979 | philip.jenvey | 2009-05-27 22:58:44 -0700 (Wed, 27 May 2009) | 2 lines explicitly close files ........
Diffstat (limited to 'Lib/test/test_difflib.py')
-rw-r--r--Lib/test/test_difflib.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/test/test_difflib.py b/Lib/test/test_difflib.py
index 8425a20..c314b53 100644
--- a/Lib/test/test_difflib.py
+++ b/Lib/test/test_difflib.py
@@ -135,14 +135,13 @@ class TestSFpatches(unittest.TestCase):
k.make_table(f3.splitlines(True),t3.splitlines(True)),
])
actual = full.replace('</body>','\n%s\n</body>' % tables)
- # temporarily uncomment next three lines to baseline this test
- #f = open('test_difflib_expect.html','w')
- #f.write(actual)
- #f.close()
- expect = open(findfile('test_difflib_expect.html')).read()
+ # temporarily uncomment next two lines to baseline this test
+ #with open('test_difflib_expect.html','w') as fp:
+ # fp.write(actual)
- self.assertEqual(actual,expect)
+ with open(findfile('test_difflib_expect.html')) as fp:
+ self.assertEqual(actual, fp.read())
def test_recursion_limit(self):
# Check if the problem described in patch #1413711 exists.