mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Properly close a file in test_minidom.
This commit is contained in:
parent
653238a88d
commit
c524692c88
1 changed files with 4 additions and 3 deletions
|
@ -73,9 +73,10 @@ class MinidomTest(unittest.TestCase):
|
|||
self.confirm(t == s, "looking for %s, found %s" % (repr(s), repr(t)))
|
||||
|
||||
def testParseFromFile(self):
|
||||
dom = parse(open(tstfile))
|
||||
dom.unlink()
|
||||
self.confirm(isinstance(dom, Document))
|
||||
with open(tstfile) as file:
|
||||
dom = parse(file)
|
||||
dom.unlink()
|
||||
self.confirm(isinstance(dom, Document))
|
||||
|
||||
def testGetElementsByTagName(self):
|
||||
dom = parse(tstfile)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue