mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-09 06:44:45 +03:00
Failing test for ResourceWarning on Python 3
This commit is contained in:
parent
cdfddc8d1a
commit
51d84d68e3
|
@ -116,6 +116,9 @@ class PillowTestCase(unittest.TestCase):
|
||||||
result = func()
|
result = func()
|
||||||
|
|
||||||
# Verify some things.
|
# Verify some things.
|
||||||
|
if warn_class is None:
|
||||||
|
self.assertEqual(len(w), 0)
|
||||||
|
else:
|
||||||
self.assertGreaterEqual(len(w), 1)
|
self.assertGreaterEqual(len(w), 1)
|
||||||
found = False
|
found = False
|
||||||
for v in w:
|
for v in w:
|
||||||
|
|
|
@ -196,6 +196,16 @@ class TestImage(PillowTestCase):
|
||||||
im3 = Image.open('Tests/images/effect_spread.png')
|
im3 = Image.open('Tests/images/effect_spread.png')
|
||||||
self.assert_image_similar(im2, im3, 110)
|
self.assert_image_similar(im2, im3, 110)
|
||||||
|
|
||||||
|
def test_no_resource_warning_on_save(self):
|
||||||
|
# https://github.com/python-pillow/Pillow/issues/835
|
||||||
|
# Arrange
|
||||||
|
test_file = 'Tests/images/hopper.png'
|
||||||
|
|
||||||
|
# Act/Assert
|
||||||
|
with Image.open(test_file) as im:
|
||||||
|
self.assert_warning(None, lambda: im.save('test_img.jpg'))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user