mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
test: narrow the async-streaming regression to openai.OpenAIError
Ruff PT011 (test tree) rejects a bare pytest.raises(Exception). Every litellm exception subclasses an openai one, so OpenAIError is the accurate common base here and matches the assertion the first test in this file already uses. The status_code == 400 assertion is unchanged.
This commit is contained in:
parent
91a3d4ea5e
commit
2bc189ff8f
1 changed files with 1 additions and 1 deletions
|
|
@ -64,7 +64,7 @@ async def test_async_streaming_missing_credentials_is_not_a_server_error(monkeyp
|
|||
monkeypatch.setattr(litellm, "api_key", None, raising=False)
|
||||
monkeypatch.setattr(litellm, "openai_key", None, raising=False)
|
||||
|
||||
with pytest.raises(Exception) as exc_info:
|
||||
with pytest.raises(openai.OpenAIError) as exc_info:
|
||||
await litellm.acompletion(
|
||||
model="gpt-4o-mini",
|
||||
messages=[{"role": "user", "content": "hi"}],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue