From 014ec9bf8e359d79d80782c1f92256160d42bf54 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sat, 11 Apr 2026 13:19:39 -0700 Subject: [PATCH] [Fix] test_databricks: don't assert stream in request body when not passed The test expected "stream": false in the serialized request body, but stream is only included in optional_params when explicitly passed by the caller. litellm.completion() defaults stream=None which is excluded from non_default_params. Assert individual fields instead of the full serialized JSON to avoid brittleness around optional field inclusion. --- tests/llm_translation/test_databricks.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/llm_translation/test_databricks.py b/tests/llm_translation/test_databricks.py index 3013d00288f..a6484b8d247 100644 --- a/tests/llm_translation/test_databricks.py +++ b/tests/llm_translation/test_databricks.py @@ -688,15 +688,11 @@ def test_completions_uses_databricks_sdk_if_api_key_and_base_not_specified(monke == f"{base_url}/serving-endpoints/chat/completions" ) assert mock_post.call_args.kwargs["stream"] == False - assert mock_post.call_args.kwargs["data"] == json.dumps( - { - "model": "dbrx-instruct-071224", - "messages": messages, - "temperature": 0.5, - "extraparam": "testpassingextraparam", - "stream": False, - } - ) + sent_data = json.loads(mock_post.call_args.kwargs["data"]) + assert sent_data["model"] == "dbrx-instruct-071224" + assert sent_data["messages"] == messages + assert sent_data["temperature"] == 0.5 + assert sent_data["extraparam"] == "testpassingextraparam" def test_embeddings_with_sync_http_handler(monkeypatch):