Merge pull request #39457 from BerriAI/litellm_e2e_openai_model_not_found_404

test(responses): expect the 404 OpenAI now returns for an unknown model
This commit is contained in:
Mateo Wang 2026-09-02 18:24:58 -07:00 • committed by GitHub
commit 3b937465c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,5 +1,5 @@
import httpx
from openai import OpenAI, BadRequestError, APIStatusError
from openai import OpenAI, BadRequestError, NotFoundError, APIStatusError
import pytest
@ -105,10 +105,9 @@ def test_streaming_response():
assert len(collected_chunks) > 0
def test_bad_request_error():
def test_model_not_found_error():
client = get_test_client()
with pytest.raises(BadRequestError):
# Trigger error with invalid model name
with pytest.raises(NotFoundError):
client.responses.create(model="non-existent-model", input="This should fail")