mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +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)))
|
self.confirm(t == s, "looking for %s, found %s" % (repr(s), repr(t)))
|
||||||
|
|
||||||
def testParseFromFile(self):
|
def testParseFromFile(self):
|
||||||
dom = parse(open(tstfile))
|
with open(tstfile) as file:
|
||||||
dom.unlink()
|
dom = parse(file)
|
||||||
self.confirm(isinstance(dom, Document))
|
dom.unlink()
|
||||||
|
self.confirm(isinstance(dom, Document))
|
||||||
|
|
||||||
def testGetElementsByTagName(self):
|
def testGetElementsByTagName(self):
|
||||||
dom = parse(tstfile)
|
dom = parse(tstfile)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue