Skip to content

Commit

Permalink
Reorganised test to use parametrize
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed May 1, 2021
1 parent 037d07a commit d4d8a8d
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions Tests/test_imageops.py
Expand Up @@ -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():
Expand Down

0 comments on commit d4d8a8d

Please sign in to comment.