Unverified Commit fbbe1b8a authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Fix `test_load_img_url_timeout` (#25976)



* fix

* fix

* fix

---------
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent feec5695
...@@ -21,7 +21,7 @@ import datasets ...@@ -21,7 +21,7 @@ import datasets
import numpy as np import numpy as np
import pytest import pytest
from huggingface_hub.file_download import http_get 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 tests.pipelines.test_pipelines_document_question_answering import INVOICE_URL
from transformers import is_torch_available, is_vision_available from transformers import is_torch_available, is_vision_available
...@@ -491,7 +491,7 @@ class LoadImageTester(unittest.TestCase): ...@@ -491,7 +491,7 @@ class LoadImageTester(unittest.TestCase):
@is_flaky() @is_flaky()
def test_load_img_url_timeout(self): def test_load_img_url_timeout(self):
with self.assertRaises(ReadTimeout): with self.assertRaises((ReadTimeout, ConnectTimeout)):
load_image(INVOICE_URL, timeout=0.001) load_image(INVOICE_URL, timeout=0.001)
def test_load_img_local(self): def test_load_img_local(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment