From 6215cd3e0fe1cc8bbecb5173badcd13e85135b2f Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 6 Jul 2023 09:28:35 -0400 Subject: [PATCH] Update tests to handle no longer raising --- Tests/test_file_jpeg.py | 5 ++--- Tests/test_file_png.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Tests/test_file_jpeg.py b/Tests/test_file_jpeg.py index 0247527f5b2..1dc82ef1e16 100644 --- a/Tests/test_file_jpeg.py +++ b/Tests/test_file_jpeg.py @@ -929,11 +929,10 @@ def test_repr_jpeg(self): assert repr_jpeg.format == "JPEG" assert_image_similar(im, repr_jpeg, 17) - def test_repr_jpeg_error(self): + def test_repr_jpeg_error_returns_none(self): im = hopper("F") - with pytest.raises(ValueError): - im._repr_jpeg_() + assert im._repr_jpeg_() is None @pytest.mark.skipif(not is_win32(), reason="Windows only") diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py index c4db9790524..3ffe93c6d15 100644 --- a/Tests/test_file_png.py +++ b/Tests/test_file_png.py @@ -532,11 +532,10 @@ def test_repr_png(self): assert repr_png.format == "PNG" assert_image_equal(im, repr_png) - def test_repr_png_error(self): + def test_repr_png_error_returns_none(self): im = hopper("F") - with pytest.raises(ValueError): - im._repr_png_() + assert im._repr_png_() is None def test_chunk_order(self, tmp_path): with Image.open("Tests/images/icc_profile.png") as im: