mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
improve error message
This commit is contained in:
parent
98042cd4b7
commit
cf25722a73
|
@ -307,9 +307,9 @@ class CoreResampleAlphaCorrectTest(PillowTestCase):
|
|||
class CoreResamplePassesTest(PillowTestCase):
|
||||
@contextmanager
|
||||
def count(self, diff):
|
||||
count = Image.core.getcount() + diff
|
||||
count = Image.core.getcount()
|
||||
yield
|
||||
self.assertEqual(Image.core.getcount(), count)
|
||||
self.assertEqual(Image.core.getcount() - count, diff)
|
||||
|
||||
def test_horizontal(self):
|
||||
im = hopper('L')
|
||||
|
@ -332,7 +332,8 @@ class CoreResamplePassesTest(PillowTestCase):
|
|||
with self.count(1):
|
||||
# the same size, but different box
|
||||
with_box = im.resize(im.size, Image.BILINEAR, box)
|
||||
cropped = im.crop(box).resize(im.size, Image.BILINEAR)
|
||||
with self.count(2):
|
||||
cropped = im.crop(box).resize(im.size, Image.BILINEAR)
|
||||
self.assert_image_similar(with_box, cropped, 0.1)
|
||||
|
||||
def test_box_vertical(self):
|
||||
|
@ -341,7 +342,8 @@ class CoreResamplePassesTest(PillowTestCase):
|
|||
with self.count(1):
|
||||
# the same size, but different box
|
||||
with_box = im.resize(im.size, Image.BILINEAR, box)
|
||||
cropped = im.crop(box).resize(im.size, Image.BILINEAR)
|
||||
with self.count(2):
|
||||
cropped = im.crop(box).resize(im.size, Image.BILINEAR)
|
||||
self.assert_image_similar(with_box, cropped, 0.1)
|
||||
|
||||
class CoreResampleCoefficientsTest(PillowTestCase):
|
||||
|
|
Loading…
Reference in New Issue
Block a user