Skip to content

Commit 459bcb9

Browse files
committed
test fixes
1 parent 1f7f045 commit 459bcb9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/integration/test_groundlight.py

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

3333
DEFAULT_CONFIDENCE_THRESHOLD = 0.9
@@ -85,13 +85,13 @@ def test_create_groundlight_with_retries():
8585
"""Verify that the `retries` parameter can be successfully passed to the `Groundlight` constructor."""
8686
# Set retries using int value
8787
num_retries = 25
88-
gl = Groundlight(retries=num_retries)
88+
gl = Groundlight(http_transport_retries=num_retries)
8989
assert gl.configuration.retries == num_retries
9090
assert gl.api_client.configuration.retries == num_retries
9191

9292
# Set retries using Retry object
9393
retries = Retry(total=num_retries)
94-
gl = Groundlight(retries=retries)
94+
gl = Groundlight(http_transport_retries=retries)
9595
assert gl.configuration.retries.total == retries.total
9696
assert gl.api_client.configuration.retries.total == retries.total
9797

@@ -386,12 +386,12 @@ 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 is
387387
exceeded. Verifies that request_timeout parameter can be a float or a tuple.
388388
"""
389-
with pytest.raises(MaxRetryError):
389+
with pytest.raises(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(MaxRetryError):
394+
with pytest.raises(ReadTimeoutError):
395395
# Ensure a tuple can be passed.
396396
gl.submit_image_query(detector=detector, image=image, human_review="NEVER", request_timeout=(1e-8, 1e-8))
397397

0 commit comments

Comments
 (0)