mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
explicitly close files
This commit is contained in:
parent
dd0388a1c2
commit
6a111027f2
3 changed files with 29 additions and 30 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue