From a658f200050f765325fbc2f1c5f3c046506c457e Mon Sep 17 00:00:00 2001 From: yucheng Date: Mon, 14 Sep 2026 22:14:24 +0000 Subject: [PATCH] test(guardrails): grant premium_user for the tagged Mode case in llm_as_a_judge mode-shape test Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/test_litellm/proxy/guardrails/test_llm_as_a_judge.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_litellm/proxy/guardrails/test_llm_as_a_judge.py b/tests/test_litellm/proxy/guardrails/test_llm_as_a_judge.py index 21f58bcee4b..2c121022cd2 100644 --- a/tests/test_litellm/proxy/guardrails/test_llm_as_a_judge.py +++ b/tests/test_litellm/proxy/guardrails/test_llm_as_a_judge.py @@ -156,9 +156,11 @@ def test_initialize_guardrail_preserves_every_mode_shape( lp: Final = _make_litellm_params(mode=mode) instance: Final = initialize_guardrail(lp, _make_guardrail_dict()) request_data: Final[dict[str, object]] = {"metadata": {"guardrails": ["g"], "tags": ["judge"]}} + premium: Final = patch("litellm.proxy.proxy_server.premium_user", True) # test-quality-ok: no seam for Mode tags try: - assert instance.should_run_guardrail(request_data, GuardrailEventHooks.pre_call) is runs_pre_call - assert instance.should_run_guardrail(request_data, GuardrailEventHooks.post_call) is runs_post_call + with premium: + assert instance.should_run_guardrail(request_data, GuardrailEventHooks.pre_call) is runs_pre_call + assert instance.should_run_guardrail(request_data, GuardrailEventHooks.post_call) is runs_post_call finally: litellm.logging_callback_manager.remove_callback_from_all_lists(instance)