mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-25 00:34:14 +03:00
Reorganised test to use parametrize
This commit is contained in:
parent
38a520c109
commit
d22fe41776
|
@ -102,19 +102,11 @@ def test_fit_same_ratio():
|
|||
assert new_im.size == (1000, 755)
|
||||
|
||||
|
||||
def test_contain():
|
||||
# Same ratio
|
||||
@pytest.mark.parametrize("new_size", ((256, 256), (512, 256), (256, 512)))
|
||||
def test_contain(new_size):
|
||||
im = hopper()
|
||||
new_size = (im.width * 2, im.height * 2)
|
||||
new_im = ImageOps.contain(im, new_size)
|
||||
assert new_im.size == new_size
|
||||
|
||||
for new_size in [
|
||||
(im.width * 4, im.height * 2),
|
||||
(im.width * 2, im.height * 4),
|
||||
]:
|
||||
new_im = ImageOps.contain(im, new_size)
|
||||
assert new_im.size == (im.width * 2, im.height * 2)
|
||||
assert new_im.size == (256, 256)
|
||||
|
||||
|
||||
def test_pad():
|
||||
|
|
Loading…
Reference in New Issue
Block a user