From df7e7e13e14d9dc780d4e2f2bc65d9eff467266f Mon Sep 17 00:00:00 2001 From: yucheng Date: Wed, 30 Sep 2026 19:38:37 +0000 Subject: [PATCH] test(guardrails): fix scope test lint issues Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../observability/test_logging_only_scope_runtime.py | 4 ++-- .../test_litellm/proxy/guardrails/test_guardrail_registry.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/observability/test_logging_only_scope_runtime.py b/tests/integration/observability/test_logging_only_scope_runtime.py index 70cf10878f5..dd00378401e 100644 --- a/tests/integration/observability/test_logging_only_scope_runtime.py +++ b/tests/integration/observability/test_logging_only_scope_runtime.py @@ -530,7 +530,7 @@ def test_logging_only_monitor_counts_only_the_observed_direction( today: Final = datetime.now(timezone.utc).date().isoformat() for identity in (input_identity, output_identity): detail: Final = eventually( - lambda: candidate.request( + lambda identity=identity: candidate.request( "GET", f"/guardrails/usage/detail/{guardrail_ids[identity]}", params={"start_date": today, "end_date": today}, @@ -966,7 +966,7 @@ def test_X1_missing_null_and_both_scope_have_identical_scans(gateway: Gateway, t expected_directions: Final = _directions_for_audit_leg(("request", "response"), scope) eventually( lambda: edge.received.qsize(), - lambda count: count == len(expected_directions), + lambda count, expected_directions=expected_directions: count == len(expected_directions), seconds=20, ) payloads: Final = tuple(JSON_OBJECT.validate_json(call.body) for call in edge.drain()) diff --git a/tests/test_litellm/proxy/guardrails/test_guardrail_registry.py b/tests/test_litellm/proxy/guardrails/test_guardrail_registry.py index be01d8ee89f..152fd36e83e 100644 --- a/tests/test_litellm/proxy/guardrails/test_guardrail_registry.py +++ b/tests/test_litellm/proxy/guardrails/test_guardrail_registry.py @@ -1156,7 +1156,7 @@ class TestLoggingOnlyScopeValidation: callback_lists: Final = _all_callback_lists() callback_snapshots: Final = [list(callback_list) for callback_list in callback_lists] - with pytest.raises(ValueError): + with pytest.raises(ValueError, match="logging_only_scope"): handler.initialize_guardrail( guardrail=_invalid_scope_content_filter_guardrail(), source="config",