A numpy failing test for ResourceWarning on Python 3

This commit is contained in:
hugovk 2014-12-30 17:02:59 +02:00
parent e96ea66729
commit 739cb150ac

View File

@ -205,6 +205,16 @@ class TestImage(PillowTestCase):
with Image.open(test_file) as im:
self.assert_warning(None, lambda: im.save('test_img.jpg'))
def test_no_resource_warning_for_numpy_array(self):
# https://github.com/python-pillow/Pillow/issues/835
# Arrange
from numpy import array
test_file = 'Tests/images/hopper.png'
im = Image.open(test_file)
# Act/Assert
self.assert_warning(None, lambda: array(im))
if __name__ == '__main__':
unittest.main()