|
27 | 27 | PaginatedDetectorList, |
28 | 28 | PaginatedImageQueryList, |
29 | 29 | ) |
30 | | -from urllib3.exceptions import MaxRetryError |
| 30 | +from urllib3.exceptions import MaxRetryError, ReadTimeoutError |
31 | 31 | from urllib3.util.retry import Retry |
32 | 32 |
|
33 | 33 | DEFAULT_CONFIDENCE_THRESHOLD = 0.9 |
@@ -85,13 +85,13 @@ def test_create_groundlight_with_retries(): |
85 | 85 | """Verify that the `retries` parameter can be successfully passed to the `Groundlight` constructor.""" |
86 | 86 | # Set retries using int value |
87 | 87 | num_retries = 25 |
88 | | - gl = Groundlight(retries=num_retries) |
| 88 | + gl = Groundlight(http_transport_retries=num_retries) |
89 | 89 | assert gl.configuration.retries == num_retries |
90 | 90 | assert gl.api_client.configuration.retries == num_retries |
91 | 91 |
|
92 | 92 | # Set retries using Retry object |
93 | 93 | retries = Retry(total=num_retries) |
94 | | - gl = Groundlight(retries=retries) |
| 94 | + gl = Groundlight(http_transport_retries=retries) |
95 | 95 | assert gl.configuration.retries.total == retries.total |
96 | 96 | assert gl.api_client.configuration.retries.total == retries.total |
97 | 97 |
|
@@ -386,12 +386,12 @@ def test_submit_image_query_with_low_request_timeout(gl: Groundlight, detector: |
386 | 386 | Verifies that submit_image_query respects the request_timeout parameter and raises a ReadTimeoutError when timeout is |
387 | 387 | exceeded. Verifies that request_timeout parameter can be a float or a tuple. |
388 | 388 | """ |
389 | | - with pytest.raises(MaxRetryError): |
| 389 | + with pytest.raises(ReadTimeoutError): |
390 | 390 | # Setting a very low request_timeout value should result in a timeout. |
391 | 391 | # NOTE: request_timeout=0 seems to have special behavior that does not result in a timeout. |
392 | 392 | gl.submit_image_query(detector=detector, image=image, human_review="NEVER", request_timeout=1e-8) |
393 | 393 |
|
394 | | - with pytest.raises(MaxRetryError): |
| 394 | + with pytest.raises(ReadTimeoutError): |
395 | 395 | # Ensure a tuple can be passed. |
396 | 396 | gl.submit_image_query(detector=detector, image=image, human_review="NEVER", request_timeout=(1e-8, 1e-8)) |
397 | 397 |
|
|
0 commit comments