Skip to content

Commit

Permalink
Fix test_load_img_url_timeout (huggingface#25976)
Browse files Browse the repository at this point in the history
* fix

* fix

* fix

---------

Co-authored-by: ydshieh <[email protected]>
  • Loading branch information
2 people authored and parambharat committed Sep 26, 2023
1 parent 265a2a8 commit 6dc5f72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/utils/test_image_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 6dc5f72

Please sign in to comment.