mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
test: handle unstable tests
This commit is contained in:
parent
6badf8efd3
commit
c088442658
2 changed files with 10 additions and 5 deletions
|
@ -730,6 +730,8 @@ class BaseLLMChatTest(ABC):
|
||||||
second_response.choices[0].message.content is not None
|
second_response.choices[0].message.content is not None
|
||||||
or second_response.choices[0].message.tool_calls is not None
|
or second_response.choices[0].message.tool_calls is not None
|
||||||
)
|
)
|
||||||
|
except litellm.InternalServerError:
|
||||||
|
pytest.skip("Model is overloaded")
|
||||||
except litellm.RateLimitError:
|
except litellm.RateLimitError:
|
||||||
pass
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
@ -287,11 +287,14 @@ class TestOpenAIChatCompletion(BaseLLMChatTest):
|
||||||
Context: https://github.com/openai/openai-python/issues/1921
|
Context: https://github.com/openai/openai-python/issues/1921
|
||||||
"""
|
"""
|
||||||
base_completion_call_args = self.get_base_completion_call_args()
|
base_completion_call_args = self.get_base_completion_call_args()
|
||||||
|
try:
|
||||||
response = self.completion_function(
|
response = self.completion_function(
|
||||||
**base_completion_call_args,
|
**base_completion_call_args,
|
||||||
messages=[{"role": "user", "content": "你好世界!\ud83e, ö"}],
|
messages=[{"role": "user", "content": "你好世界!\ud83e, ö"}],
|
||||||
)
|
)
|
||||||
assert response is not None
|
assert response is not None
|
||||||
|
except litellm.InternalServerError:
|
||||||
|
pytest.skip("Skipping test due to InternalServerError")
|
||||||
|
|
||||||
|
|
||||||
def test_completion_bad_org():
|
def test_completion_bad_org():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue