mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-21 00:21:49 +00:00
test(guardrails): make callback cleanup defensive
Signed-off-by: xrwang8 <xrwang8@gmail.com>
This commit is contained in:
parent
9187ed52ce
commit
1b3cec0f53
1 changed files with 2 additions and 1 deletions
|
|
@ -115,7 +115,8 @@ class TestContentFilterGuardrail:
|
|||
|
||||
assert result["texts"] == ["Call <<PHONE_NUMBER>> about <<KEYWORD>>"]
|
||||
finally:
|
||||
litellm.callbacks.remove(guardrail)
|
||||
if guardrail in litellm.callbacks:
|
||||
litellm.callbacks.remove(guardrail)
|
||||
|
||||
def test_check_patterns_ssn(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue