From 73ae9c65dda8269ee7c00921c540c32e79a2e19e Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Mon, 17 Aug 2026 12:42:57 -0700 Subject: [PATCH] test(proxy): give the x-litellm-model fallback test deterministic openai env creds --- .../test_litellm/proxy/test_batch_x_litellm_model_encoding.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_litellm/proxy/test_batch_x_litellm_model_encoding.py b/tests/test_litellm/proxy/test_batch_x_litellm_model_encoding.py index 101dc48603a..3d1831bb4cd 100644 --- a/tests/test_litellm/proxy/test_batch_x_litellm_model_encoding.py +++ b/tests/test_litellm/proxy/test_batch_x_litellm_model_encoding.py @@ -287,13 +287,15 @@ async def test_create_batch_with_x_litellm_model_encodes_output_and_error_file_i @pytest.mark.asyncio -async def test_create_batch_without_x_litellm_model_returns_raw_ids(): +async def test_create_batch_without_x_litellm_model_returns_raw_ids(monkeypatch): """ Without x-litellm-model header, create_batch should NOT encode batch IDs (falls through to Scenario 3 / custom_llm_provider fallback). """ from litellm.proxy.batches_endpoints.endpoints import create_batch + monkeypatch.setenv("OPENAI_API_KEY", "sk-env-openai") + raw_batch_id = "batch_abc123" mock_response = _make_batch_response(batch_id=raw_batch_id) mock_request = _make_mock_request(headers={})