1import pytest 2 3from botocore import exceptions as botocore_exceptions 4from botocore.vendored.requests import exceptions as requests_exceptions 5from botocore.vendored.requests.packages.urllib3 import exceptions as urllib3_exceptions 6 7 8@pytest.mark.parametrize( 9 "new_exception, old_exception", 10 ( 11 (botocore_exceptions.ReadTimeoutError, requests_exceptions.ReadTimeout), 12 (botocore_exceptions.ReadTimeoutError, urllib3_exceptions.ReadTimeoutError), 13 (botocore_exceptions.ConnectTimeoutError, requests_exceptions.ConnectTimeout), 14 (botocore_exceptions.ProxyConnectionError, requests_exceptions.ProxyError), 15 (botocore_exceptions.SSLError, requests_exceptions.SSLError), 16 ), 17) 18def test_http_client_exception_mapping(new_exception, old_exception): 19 # assert that the new exception can still be caught by the old vendored one 20 with pytest.raises(old_exception): 21 raise new_exception(endpoint_url=None, proxy_url=None, error=None) 22