diff --git a/Tests/test_file_webp.py b/Tests/test_file_webp.py index d6cc39fd877..14a2d2317a1 100644 --- a/Tests/test_file_webp.py +++ b/Tests/test_file_webp.py @@ -166,7 +166,7 @@ def test_write_encoding_error_message(self, tmp_path: Path) -> None: @pytest.mark.skipif(sys.maxsize <= 2**32, reason="Requires 64-bit system") def test_write_encoding_error_bad_dimension(self, tmp_path: Path) -> None: - im = Image.new("L", (16384, 16384)) + im = Image.new("L", (16384, 1)) with pytest.raises(ValueError) as e: im.save(tmp_path / "temp.webp") assert ( diff --git a/Tests/test_map.py b/Tests/test_map.py index 1278ba3a6d6..4096f408636 100644 --- a/Tests/test_map.py +++ b/Tests/test_map.py @@ -34,8 +34,6 @@ def test_tobytes(monkeypatch: pytest.MonkeyPatch) -> None: @pytest.mark.skipif(sys.maxsize <= 2**32, reason="Requires 64-bit system") def test_ysize() -> None: - numpy = pytest.importorskip("numpy", reason="NumPy not installed") - # Should not raise 'Integer overflow in ysize' - arr = numpy.zeros((46341, 46341), dtype=numpy.uint8) - Image.fromarray(arr) + with pytest.raises(ValueError, match="buffer is not large enough"): + Image.frombuffer("L", (46341, 46341), b"")