close right after write

This commit is contained in:
Henri Chain 2016-05-24 11:42:23 +02:00
parent 957c4cbb43
commit 701f4aaf6e

View File

@ -115,6 +115,7 @@ class TestForeign(unittest.TestCase):
buf = Vips.call(saver, im) buf = Vips.call(saver, im)
f = NamedTemporaryFile(suffix=suf, delete=False) f = NamedTemporaryFile(suffix=suf, delete=False)
f.write(buf) f.write(buf)
f.close()
x = Vips.Image.new_from_file(f.name) x = Vips.Image.new_from_file(f.name)
self.assertEqual(im.width, x.width) self.assertEqual(im.width, x.width)
@ -122,7 +123,6 @@ class TestForeign(unittest.TestCase):
self.assertEqual(im.bands, x.bands) self.assertEqual(im.bands, x.bands)
self.assertLessEqual((im - x).abs().max(), max_diff) self.assertLessEqual((im - x).abs().max(), max_diff)
f.close()
os.unlink(f.name) os.unlink(f.name)
def test_vips(self): def test_vips(self):