diff --git a/Tests/test_file_dds.py b/Tests/test_file_dds.py index 931ff02f1..98b9e0fb5 100644 --- a/Tests/test_file_dds.py +++ b/Tests/test_file_dds.py @@ -15,6 +15,7 @@ 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" @@ -540,3 +541,18 @@ def test_save_large_file(tmp_path: Path, pixel_format: str, mode: str) -> None: im = hopper(mode).resize((440, 440)) # should not error in valgrind im.save(tmp_path / "img.dds", pixel_format=pixel_format) + + +@timeout_unless_slower_valgrind(1) +@pytest.mark.parametrize( + "test_file", + [ + "Tests/images/timeout-041dd17dfde800360a47a172269df127af138c6b.dds", + "Tests/images/timeout-755a4d204f4208e3597ac3391edebee196462bd0.dds", + "Tests/images/timeout-52d106579505547091ef69b58341351a37c23e31.dds", + "Tests/images/timeout-c60a3d7314213624607bfb3e38d551a8b24a7435.dds", + ], +) +def test_timeout(test_file) -> None: + with Image.open(test_file) as im: + im.load()