From 6dc5f728a5d8275a30b23903218b8724ed40f7dc Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:34:28 +0200 Subject: [PATCH] Fix `test_load_img_url_timeout` (#25976) * fix * fix * fix --------- Co-authored-by: ydshieh --- tests/utils/test_image_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utils/test_image_utils.py b/tests/utils/test_image_utils.py index 1813c2a21f2544..5d899c2f1ddf72 100644 --- a/tests/utils/test_image_utils.py +++ b/tests/utils/test_image_utils.py @@ -21,7 +21,7 @@ import numpy as np import pytest from huggingface_hub.file_download import http_get -from requests import ReadTimeout +from requests import ConnectTimeout, ReadTimeout from tests.pipelines.test_pipelines_document_question_answering import INVOICE_URL from transformers import is_torch_available, is_vision_available @@ -491,7 +491,7 @@ def test_load_img_url(self): @is_flaky() def test_load_img_url_timeout(self): - with self.assertRaises(ReadTimeout): + with self.assertRaises((ReadTimeout, ConnectTimeout)): load_image(INVOICE_URL, timeout=0.001) def test_load_img_local(self):