summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2012-04-21 12:15:11 +0200
committerStefan Behnel <stefan_ml@behnel.de>2012-04-21 12:15:11 +0200
commit7dcdd7c3341e42b7c3ad95bb6476a611e8dfee33 (patch)
treefeeaf5161341613f0c675947af7bf129cb98b05c
parentf6da87566162589bb311a062371b3e70cafe1bde (diff)
downloadpython-lxml-7dcdd7c3341e42b7c3ad95bb6476a611e8dfee33.tar.gz
close some more files in test (avoids warnings in Py3 debug builds)
-rw-r--r--src/lxml/html/tests/test_html5parser.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lxml/html/tests/test_html5parser.py b/src/lxml/html/tests/test_html5parser.py
index 8f4e202e..23e1ed77 100644
--- a/src/lxml/html/tests/test_html5parser.py
+++ b/src/lxml/html/tests/test_html5parser.py
@@ -292,7 +292,10 @@ class Test_parse(unittest.TestCase):
try:
self.assertEqual(self.call_it(tmpfile.name, parser=parser), 'the doc')
fp, = parser.parse_args
- self.assertEqual(fp.read(), tmpfile.read())
+ try:
+ self.assertEqual(fp.read(), tmpfile.read())
+ finally:
+ fp.close()
finally:
tmpfile.close()
@@ -303,7 +306,10 @@ class Test_parse(unittest.TestCase):
url = 'file://' + tmpfile.name
self.assertEqual(self.call_it(url, parser=parser), 'the doc')
fp, = parser.parse_args
- self.assertEqual(fp.read(), tmpfile.read())
+ try:
+ self.assertEqual(fp.read(), tmpfile.read())
+ finally:
+ fp.close()
finally:
tmpfile.close()