Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions Tests/test_image_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import Any

import pytest
from packaging.version import parse as parse_version

from PIL import Image

Expand Down Expand Up @@ -44,12 +43,8 @@ def test_with_dtype(dtype: npt.DTypeLike) -> None:
test_with_dtype(numpy.uint8)

with Image.open("Tests/images/truncated_jpeg.jpg") as im_truncated:
if parse_version(numpy.__version__) >= parse_version("1.23"):
with pytest.raises(OSError):
numpy.array(im_truncated)
else:
with pytest.warns(DeprecationWarning, match="__array_interface__"):
numpy.array(im_truncated)
with pytest.raises(OSError):
numpy.array(im_truncated)


def test_fromarray() -> None:
Expand Down
Loading