add timeouts to two more tests

This commit is contained in:
Eric Soroos 2025-05-23 15:32:46 +02:00
parent 2603a249df
commit 60a1a20536

View File

@ -990,6 +990,10 @@ class TestFileTiff:
@pytest.mark.timeout(6)
@pytest.mark.filterwarnings("ignore:Truncated File Read")
@pytest.mark.xfail(
"PILLOW_VALGRIND_TEST" in os.environ,
reason="Valgrind is slower"
)
def test_timeout(self, monkeypatch: pytest.MonkeyPatch) -> None:
with Image.open("Tests/images/timeout-6646305047838720") as im:
monkeypatch.setattr(ImageFile, "LOAD_TRUNCATED_IMAGES", True)
@ -1002,6 +1006,10 @@ class TestFileTiff:
],
)
@pytest.mark.timeout(2)
@pytest.mark.xfail(
"PILLOW_VALGRIND_TEST" in os.environ,
reason="Valgrind is slower"
)
def test_oom(self, test_file: str) -> None:
with pytest.raises(UnidentifiedImageError):
with pytest.warns(UserWarning):