Commit c524692c authored by Brett Cannon's avatar Brett Cannon

Properly close a file in test_minidom.

parent 653238a8
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment