|
27 | 27 | PaginatedDetectorList, |
28 | 28 | PaginatedImageQueryList, |
29 | 29 | ) |
30 | | -from urllib3.exceptions import MaxRetryError, ReadTimeoutError |
| 30 | +from urllib3.exceptions import ConnectTimeoutError, MaxRetryError, ReadTimeoutError |
31 | 31 | from urllib3.util.retry import Retry |
32 | 32 |
|
33 | 33 | DEFAULT_CONFIDENCE_THRESHOLD = 0.9 |
@@ -386,14 +386,14 @@ 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 |
387 | 387 | is exceeded. Verifies that request_timeout parameter can be a float or a tuple. |
388 | 388 | """ |
389 | | - with pytest.raises(ReadTimeoutError): |
| 389 | + with pytest.raises((ConnectTimeoutError, 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(ReadTimeoutError): |
| 394 | + with pytest.raises((ConnectTimeoutError, ReadTimeoutError)): |
395 | 395 | # 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)) |
397 | 397 |
|
398 | 398 |
|
399 | 399 | @pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint does not support passing detector metadata.") |
|
0 commit comments