diff --git a/litellm/tests/test_timeout.py b/litellm/tests/test_timeout.py index 1902e1a36..8c92607c0 100644 --- a/litellm/tests/test_timeout.py +++ b/litellm/tests/test_timeout.py @@ -37,6 +37,28 @@ def test_timeout(): # test_timeout() +def test_bedrock_timeout(): + # this Will Raise a timeout + litellm.set_verbose = True + try: + response = litellm.completion( + model="bedrock/anthropic.claude-instant-v1", + timeout=0.01, + messages=[{"role": "user", "content": "hello, write a 20 pg essay"}], + ) + pytest.fail("Did not raise error `openai.APITimeoutError`") + except openai.APITimeoutError as e: + print( + "Passed: Raised correct exception. Got openai.APITimeoutError\nGood Job", e + ) + print(type(e)) + pass + except Exception as e: + pytest.fail( + f"Did not raise error `openai.APITimeoutError`. Instead raised error type: {type(e)}, Error: {e}" + ) + + def test_hanging_request_azure(): litellm.set_verbose = True import asyncio