From 49b2d71057d4cff4e3a4baad843a7db7ac35c7c2 Mon Sep 17 00:00:00 2001 From: joshua-berri Date: Sun, 13 Sep 2026 08:47:47 +0000 Subject: [PATCH] test(guardrails): type the native lifecycle logging_only test double Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../test_litellm/integrations/test_custom_guardrail.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_litellm/integrations/test_custom_guardrail.py b/tests/test_litellm/integrations/test_custom_guardrail.py index 8095be3c0de..bb29bfed283 100644 --- a/tests/test_litellm/integrations/test_custom_guardrail.py +++ b/tests/test_litellm/integrations/test_custom_guardrail.py @@ -2902,9 +2902,15 @@ class _NativeLifecycleLoggingGuardrail(CustomGuardrail): guardrail_name="native-logging-guardrail", event_hook=GuardrailEventHooks.logging_only, ) - self.calls: list = [] + self.calls: list[tuple[Literal["request", "response"], list[str]]] = [] - async def apply_guardrail(self, inputs, request_data, input_type, logging_obj=None): + async def apply_guardrail( + self, + inputs: GenericGuardrailAPIInputs, + request_data: dict[str, object], + input_type: Literal["request", "response"], + logging_obj: "LiteLLMLoggingObj | None" = None, + ) -> GenericGuardrailAPIInputs: self.calls.append((input_type, list(inputs.get("texts") or []))) return inputs