mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-09 06:44:45 +03:00
Move test_no_resource_warning_for_numpy_array to test_numpy so it can be skipped easily
This commit is contained in:
parent
908392206e
commit
08f285d79b
|
@ -205,16 +205,6 @@ 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))
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
@ -131,6 +131,15 @@ class TestNumpy(PillowTestCase):
|
||||||
|
|
||||||
self.assertEqual(len(im.getdata()),len(arr))
|
self.assertEqual(len(im.getdata()),len(arr))
|
||||||
|
|
||||||
|
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__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user