mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-30 18:03:07 +03:00
A numpy failing test for ResourceWarning on Python 3
This commit is contained in:
parent
cde8c1b560
commit
0b6691ecc9
|
@ -514,6 +514,16 @@ class TestImage(PillowTestCase):
|
||||||
with Image.open(test_file) as im:
|
with Image.open(test_file) as im:
|
||||||
self.assert_warning(None, lambda: im.save('test_img.jpg'))
|
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))
|
||||||
|
|
||||||
|
|
||||||
class MockEncoder(object):
|
class MockEncoder(object):
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue
Block a user