Skip to content

Commit 56cc766

Browse files
committed
fix test
1 parent 0bfd0ff commit 56cc766

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/integration/test_groundlight.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
PaginatedDetectorList,
2828
PaginatedImageQueryList,
2929
)
30-
from urllib3.exceptions import MaxRetryError, ReadTimeoutError
30+
from urllib3.exceptions import ConnectTimeoutError, MaxRetryError, ReadTimeoutError
3131
from urllib3.util.retry import Retry
3232

3333
DEFAULT_CONFIDENCE_THRESHOLD = 0.9
@@ -386,14 +386,14 @@ def test_submit_image_query_with_low_request_timeout(gl: Groundlight, detector:
386386
Verifies that submit_image_query respects the request_timeout parameter and raises a ReadTimeoutError when timeout
387387
is exceeded. Verifies that request_timeout parameter can be a float or a tuple.
388388
"""
389-
with pytest.raises(ReadTimeoutError):
389+
with pytest.raises((ConnectTimeoutError, ReadTimeoutError)):
390390
# Setting a very low request_timeout value should result in a timeout.
391391
# NOTE: request_timeout=0 seems to have special behavior that does not result in a timeout.
392392
gl.submit_image_query(detector=detector, image=image, human_review="NEVER", request_timeout=1e-8)
393393

394-
with pytest.raises(ReadTimeoutError):
394+
with pytest.raises((ConnectTimeoutError, ReadTimeoutError)):
395395
# Ensure a tuple can be passed.
396-
gl.submit_image_query(detector=detector, image=image, human_review="NEVER", request_timeout=(1e-8, 1e-8))
396+
gl.submit_image_query(detector=detector, image=image, human_review="NEVER", request_timeout=(5, 1e-8))
397397

398398

399399
@pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint does not support passing detector metadata.")

0 commit comments

Comments
 (0)