Move test_no_resource_warning_for_numpy_array to test_numpy so it can be skipped easily

This commit is contained in:
hugovk 2015-01-01 12:57:43 +02:00
parent 0b6691ecc9
commit 9344bd20dd
2 changed files with 11 additions and 11 deletions

View File

@ -514,16 +514,6 @@ 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))
class MockEncoder(object):
pass

View File

@ -212,7 +212,6 @@ class TestNumpy(PillowTestCase):
self.assertEqual(im.size, (0, 0))
def test_bool(self):
# https://github.com/python-pillow/Pillow/issues/2044
a = numpy.zeros((10,2), dtype=numpy.bool)
@ -221,5 +220,16 @@ class TestNumpy(PillowTestCase):
im2 = Image.fromarray(a)
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__':
unittest.main()