diff --git a/tests/test_extract.py b/tests/test_extract.py index f708c337a0b3cc4b5fa9d7453c82741a6b2a5d9c..7ae10ecfb8a7967dded76c844b5a554e00075673 100644 --- a/tests/test_extract.py +++ b/tests/test_extract.py @@ -587,13 +587,16 @@ def test_download_image_error_try_max(responses): responses.GET, fixed_url, status=200, + body=next((FIXTURES / "prediction" / "images").iterdir()).read_bytes(), ) image = download_image(url) assert image - assert len(responses.calls) == 6 - assert list(map(attrgetter("request.url"), responses.calls)) == [url] * 5 + [ + # We try 3 times with the first URL + # Then the first try with the new URL is successful + assert len(responses.calls) == 4 + assert list(map(attrgetter("request.url"), responses.calls)) == [url] * 3 + [ fixed_url ]