diff --git a/Tests/test_image_resize.py b/Tests/test_image_resize.py index e2617edc8f1..f37fd4b04e7 100644 --- a/Tests/test_image_resize.py +++ b/Tests/test_image_resize.py @@ -230,10 +230,8 @@ def test_reducing_gap_1( (52, 34), Image.Resampling.BICUBIC, box=box, reducing_gap=1.0 ) - with pytest.raises(pytest.fail.Exception): - assert_image_equal(ref, im) - assert_image_similar(ref, im, epsilon) + assert ref.tobytes() != im.tobytes() @pytest.mark.parametrize( "box, epsilon", @@ -250,9 +248,7 @@ def test_reducing_gap_2( (52, 34), Image.Resampling.BICUBIC, box=box, reducing_gap=2.0 ) - with pytest.raises(pytest.fail.Exception): - assert_image_equal(ref, im) - + assert ref.tobytes() != im.tobytes() assert_image_similar(ref, im, epsilon) @pytest.mark.parametrize( @@ -270,9 +266,7 @@ def test_reducing_gap_3( (52, 34), Image.Resampling.BICUBIC, box=box, reducing_gap=3.0 ) - with pytest.raises(pytest.fail.Exception): - assert_image_equal(ref, im) - + assert ref.tobytes() != im.tobytes() assert_image_similar(ref, im, epsilon) @pytest.mark.parametrize("box", (None, (1.1, 2.2, 510.8, 510.9), (3, 10, 410, 256))) diff --git a/Tests/test_image_thumbnail.py b/Tests/test_image_thumbnail.py index 2ae230f3df1..00b47a2a70a 100644 --- a/Tests/test_image_thumbnail.py +++ b/Tests/test_image_thumbnail.py @@ -149,9 +149,8 @@ def test_reducing_gap_values() -> None: ref = hopper() ref.thumbnail((18, 18), Image.Resampling.BICUBIC, reducing_gap=None) - with pytest.raises(pytest.fail.Exception): - assert_image_equal(ref, im) + assert ref.tobytes() != im.tobytes() assert_image_similar(ref, im, 3.5)