From db5bfe8d28067f0d8e1abf702be2c074b8e2ff26 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 24 Jan 2026 11:13:04 +1100 Subject: [PATCH] Catch error --- Tests/test_file_dds.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Tests/test_file_dds.py b/Tests/test_file_dds.py index 98b9e0fb5..6d0ae20ea 100644 --- a/Tests/test_file_dds.py +++ b/Tests/test_file_dds.py @@ -15,7 +15,6 @@ from .helper import ( assert_image_similar, assert_image_similar_tofile, hopper, - timeout_unless_slower_valgrind, ) TEST_FILE_DXT1 = "Tests/images/dxt1-rgb-4bbp-noalpha_MipMaps-1.dds" @@ -543,7 +542,6 @@ def test_save_large_file(tmp_path: Path, pixel_format: str, mode: str) -> None: im.save(tmp_path / "img.dds", pixel_format=pixel_format) -@timeout_unless_slower_valgrind(1) @pytest.mark.parametrize( "test_file", [ @@ -553,6 +551,7 @@ def test_save_large_file(tmp_path: Path, pixel_format: str, mode: str) -> None: "Tests/images/timeout-c60a3d7314213624607bfb3e38d551a8b24a7435.dds", ], ) -def test_timeout(test_file) -> None: +def test_not_enough_image_data(test_file: str) -> None: with Image.open(test_file) as im: - im.load() + with pytest.raises(ValueError, match="not enough image data"): + im.load()