test: handle watsonx rate limit error

This commit is contained in:
Krrish Dholakia 2024-05-13 18:27:39 -07:00
parent f8e1b1db2e
commit 87a21115c5
4 changed files with 9 additions and 1 deletions

View file

@ -456,7 +456,8 @@ def test_completion_claude_stream():
print(f"completion_response: {complete_response}")
except Exception as e:
pytest.fail(f"Error occurred: {e}")
# test_completion_claude_stream()
def test_completion_claude_2_stream():
litellm.set_verbose = True
@ -1416,6 +1417,8 @@ def test_completion_watsonx_stream():
raise Exception("finish reason not set for last chunk")
if complete_response.strip() == "":
raise Exception("Empty response received")
except litellm.RateLimitError as e:
pass
except Exception as e:
pytest.fail(f"Error occurred: {e}")