Changed test to use tempfile

This commit is contained in:
Andrew Murray 2017-11-08 12:59:05 +11:00
parent 7afaf4ddde
commit 28119dd68d

View File

@ -515,10 +515,11 @@ class TestImage(PillowTestCase):
# https://github.com/python-pillow/Pillow/issues/835
# Arrange
test_file = 'Tests/images/hopper.png'
temp_file = self.tempfile("temp.jpg")
# Act/Assert
with Image.open(test_file) as im:
self.assert_warning(None, lambda: im.save('test_img.jpg'))
self.assert_warning(None, im.save, temp_file)
class MockEncoder(object):