From 750e016757afd924bdbc243c3ab6d34279e89ddd Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 13 Sep 2026 11:42:20 +1000 Subject: [PATCH 1/2] Reduce test image size --- Tests/test_file_webp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ( From 3c13c2731a6ea7f8f92005531242edf2deffc89b Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 13 Sep 2026 12:04:58 +1000 Subject: [PATCH 2/2] Test without using large amount of data --- Tests/test_map.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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"")