From 0cbf8802c149642c5e8487aebda7fb5e25638e80 Mon Sep 17 00:00:00 2001 From: aiedwardyi <41576951+aiedwardyi@users.noreply.github.com> Date: Fri, 28 Aug 2026 13:47:18 +0900 Subject: [PATCH] test: fix a2a guardrail stub arity and an unescaped raises match merge_a2a_agent_guardrails_before_hooks takes only data, so the shared passthrough stub failed the reroute test; the timeout assertion needed a raw pattern for RUF043. --- .../test_pydantic_ai_agent_transformation.py | 2 +- tests/test_litellm/proxy/test_common_request_processing.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_litellm/a2a_protocol/providers/pydantic_ai_agents/test_pydantic_ai_agent_transformation.py b/tests/test_litellm/a2a_protocol/providers/pydantic_ai_agents/test_pydantic_ai_agent_transformation.py index 22679d02f06..8b40b64987f 100644 --- a/tests/test_litellm/a2a_protocol/providers/pydantic_ai_agents/test_pydantic_ai_agent_transformation.py +++ b/tests/test_litellm/a2a_protocol/providers/pydantic_ai_agents/test_pydantic_ai_agent_transformation.py @@ -110,7 +110,7 @@ async def test_poll_for_completion_honors_request_timeout(): "litellm.a2a_protocol.providers.pydantic_ai_agents.transformation.time.monotonic", side_effect=[100.0, 100.0, 100.02], ): - with pytest.raises(TimeoutError, match="0.01 seconds"): + with pytest.raises(TimeoutError, match=r"0\.01 seconds"): await PydanticAITransformation._poll_for_completion( client=client, endpoint="http://example.test", diff --git a/tests/test_litellm/proxy/test_common_request_processing.py b/tests/test_litellm/proxy/test_common_request_processing.py index b755255fb48..3b2beac0947 100644 --- a/tests/test_litellm/proxy/test_common_request_processing.py +++ b/tests/test_litellm/proxy/test_common_request_processing.py @@ -6273,6 +6273,9 @@ class TestPerRequestModelGroupAlias: async def passthrough(data, user_api_key_dict): return data + async def passthrough_data_only(data): + return data + mock_proxy_logging_obj = MagicMock(spec=ProxyLogging) mock_proxy_logging_obj.pre_call_hook = AsyncMock(side_effect=reroute_once) monkeypatch.setattr( @@ -6296,7 +6299,7 @@ class TestPerRequestModelGroupAlias: ) monkeypatch.setattr( "litellm.proxy.agent_endpoints.a2a_routing.merge_a2a_agent_guardrails_before_hooks", - passthrough, + passthrough_data_only, ) returned_data, _ = await processing_obj.common_processing_pre_call_logic(