Skip to content

Commit

Permalink
Update tests to handle no longer raising
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish committed Jul 6, 2023
1 parent 9517fec commit 6215cd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Tests/test_file_jpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 2 additions & 3 deletions Tests/test_file_png.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6215cd3

Please sign in to comment.