Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(chatgpt): restore gpt-5.2 codex transformation coverage

Vincent Kocfb935a61ae0c
diff --git a/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.py b/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.py
index 6e3cca309a9..c0a0927b7d1 100644
--- a/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.py
+++ b/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.py
@@ -84,10 +84,17 @@ class TestChatGPTResponsesAPITransformation:
assert headers["accept"] == "text/event-stream"
assert headers["session_id"] == "session-123"
- def test_chatgpt_forces_streaming_and_reasoning_include(self):
+ @pytest.mark.parametrize(
+ "model_name",
+ [
+ "chatgpt/gpt-5.2-codex",
+ "chatgpt/gpt-5.3-codex",
+ ],
+ )
+ def test_chatgpt_forces_streaming_and_reasoning_include(self, model_name):
config = ChatGPTResponsesAPIConfig()
request = config.transform_responses_api_request(
- model="chatgpt/gpt-5.3-codex",
+ model=model_name,
input="hi",
response_api_optional_request_params={},
litellm_params=GenericLiteLLMParams(),
@@ -100,10 +107,17 @@ class TestChatGPTResponsesAPITransformation:
"You are Codex, based on GPT-5."
)
- def test_chatgpt_drops_unsupported_responses_params(self):
+ @pytest.mark.parametrize(
+ "model_name",
+ [
+ "chatgpt/gpt-5.2-codex",
+ "chatgpt/gpt-5.3-codex-spark",
+ ],
+ )
+ def test_chatgpt_drops_unsupported_responses_params(self, model_name):
config = ChatGPTResponsesAPIConfig()
request = config.transform_responses_api_request(
- model="chatgpt/gpt-5.3-codex-spark",
+ model=model_name,
input="hi",
response_api_optional_request_params={
# unsupported by ChatGPT Codex
@@ -139,14 +153,23 @@ class TestChatGPTResponsesAPITransformation:
assert request["tools"] == [{"type": "function", "function": {"name": "hello"}}]
assert request["tool_choice"] == {"type": "function", "function": {"name": "hello"}}
- def test_chatgpt_non_stream_sse_response_parsing(self):
+ @pytest.mark.parametrize(
+ ("model_name", "response_model"),
+ [
+ ("chatgpt/gpt-5.2-codex", "gpt-5.2-codex"),
+ ("chatgpt/gpt-5.3-codex", "gpt-5.3-codex"),
+ ],
+ )
+ def test_chatgpt_non_stream_sse_response_parsing(
+ self, model_name: str, response_model: str
+ ):
config = ChatGPTResponsesAPIConfig()
response_payload = {
"id": "resp_test",
"object": "response",
"created_at": 1700000000,
"status": "completed",
- "model": "gpt-5.3-codex",
+ "model": response_model,
"output": [
{
"type": "message",
@@ -168,7 +191,7 @@ class TestChatGPTResponsesAPITransformation:
logging_obj = MagicMock()
parsed = config.transform_response_api_response(
- model="chatgpt/gpt-5.3-codex",
+ model=model_name,
raw_response=raw_response,
logging_obj=logging_obj,
)