litellm/tests/test_litellm/proxy/guardrails
shivam 614fdcbb1b
refactor(proxy): extract deferred-logging gate into static helper for direct test coverage
Code review noted the previous test reimplemented the proxy's
try/except/finally around post_call_success_hook, so it would not catch a
regression that re-introduced the duplicate-log bug in the production code
path. Extract the gating logic into
`ProxyBaseLLMRequestProcessing._flush_deferred_async_logging` so tests
exercise the production helper directly.

The proxy finally block becomes a single call to the helper. Tests now
invoke the helper itself and additionally assert (via inspect.getsource)
that base_process_llm_request continues to delegate to the helper rather
than inlining the gate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 15:39:26 -07:00
..
guardrail_hooks fix(bedrock guardrail): dedupe post-call log entry when only post_call is configured (#26474) 2026-04-25 14:30:06 -07:00
test_custom_code_security.py fix(guardrails): provide _inplacevar_ to sandbox 2026-04-15 15:45:25 -07:00
test_deferred_guardrail_logging.py refactor(proxy): extract deferred-logging gate into static helper for direct test coverage 2026-04-25 15:39:26 -07:00
test_guardrail_endpoints.py fix: tighten guardrail param handling in list and submission endpoints 2026-04-23 23:13:06 -07:00
test_guardrail_registry.py Add Noma guardrails v2 based on custom guardrails (#21400) 2026-02-23 05:05:27 -08:00
test_init_guardrails.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_llm_as_a_judge.py feat(guardrails): LLM-as-a-Judge guardrail (#26360) 2026-04-24 17:15:32 -07:00
test_mcp_jwt_signer.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_pillar_guardrails.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_prompt_security_guardrails.py fixing prompt-security's guardrail implementation (#19374) 2026-01-21 20:09:40 -08:00