From 0e0683a2a2fdf78f03eebe4955d68351d998a49b Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 8 Oct 2026 21:40:19 +0530 Subject: [PATCH] test(litellm): make tool-call argument log tests independent of test order TestParseToolCallArguments lowered only the root logger with caplog.at_level(logging.DEBUG). When a CLI test runs earlier in the same process, setup_adk_logger() leaves the "google_adk" logger at INFO, so lite_llm skips its DEBUG branch and four tests fail depending on test order. Set the level on the "google_adk" logger explicitly, as is already done elsewhere in this file. --- tests/unittests/models/test_litellm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unittests/models/test_litellm.py b/tests/unittests/models/test_litellm.py index 2f4e880c0e..d8b64526f7 100644 --- a/tests/unittests/models/test_litellm.py +++ b/tests/unittests/models/test_litellm.py @@ -10762,7 +10762,7 @@ def test_repaired_arguments_log_warning_without_raw_payload(self, caplog): def test_repaired_arguments_log_debug_with_raw_payload(self, caplog): """Repaired non-strict JSON arguments emit warning with payload at debug level.""" - with caplog.at_level(logging.DEBUG): + with caplog.at_level(logging.DEBUG, logger="google_adk"): _parse_tool_call_arguments("{a: 1}", function_name="test_fn") assert "test_fn" in caplog.text assert "{a: 1}" in caplog.text @@ -10780,7 +10780,7 @@ def test_repaired_arguments_without_function_name(self, caplog): assert "{a: 1}" not in caplog.text caplog.clear() - with caplog.at_level(logging.DEBUG): + with caplog.at_level(logging.DEBUG, logger="google_adk"): _parse_tool_call_arguments("{a: 1}") warning_records = [ r for r in caplog.records if r.levelno == logging.WARNING @@ -10794,7 +10794,7 @@ def test_literal_eval_layer_logs_debug_not_warning(self, caplog): _parse_tool_call_arguments("{'a': 1}", function_name="test_fn") assert not any(r.levelno == logging.WARNING for r in caplog.records) - with caplog.at_level(logging.DEBUG): + with caplog.at_level(logging.DEBUG, logger="google_adk"): _parse_tool_call_arguments("{'a': 1}", function_name="test_fn") assert not any(r.levelno == logging.WARNING for r in caplog.records) debug_records = [ @@ -10808,7 +10808,7 @@ def test_literal_eval_layer_logs_debug_not_warning(self, caplog): def test_literal_eval_without_function_name_logs_debug(self, caplog): """Python dict literal without function_name logs at debug.""" - with caplog.at_level(logging.DEBUG): + with caplog.at_level(logging.DEBUG, logger="google_adk"): _parse_tool_call_arguments("{'a': 1}") assert not any(r.levelno == logging.WARNING for r in caplog.records) debug_records = [