mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-05 00:13:42 +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
0b6691ecc9
commit
9344bd20dd
|
@ -514,16 +514,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))
|
|
||||||
|
|
||||||
|
|
||||||
class MockEncoder(object):
|
class MockEncoder(object):
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -212,7 +212,6 @@ class TestNumpy(PillowTestCase):
|
||||||
|
|
||||||
self.assertEqual(im.size, (0, 0))
|
self.assertEqual(im.size, (0, 0))
|
||||||
|
|
||||||
|
|
||||||
def test_bool(self):
|
def test_bool(self):
|
||||||
# https://github.com/python-pillow/Pillow/issues/2044
|
# https://github.com/python-pillow/Pillow/issues/2044
|
||||||
a = numpy.zeros((10,2), dtype=numpy.bool)
|
a = numpy.zeros((10,2), dtype=numpy.bool)
|
||||||
|
@ -221,5 +220,16 @@ class TestNumpy(PillowTestCase):
|
||||||
im2 = Image.fromarray(a)
|
im2 = Image.fromarray(a)
|
||||||
self.assertEqual(im2.getdata()[0], 255)
|
self.assertEqual(im2.getdata()[0], 255)
|
||||||
|
|
||||||
|
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