From 7f8311d3e9c13a53f16f5c1debe3f2e7f6b0b1ef Mon Sep 17 00:00:00 2001 From: Vigilans Date: Mon, 20 Apr 2026 16:21:17 +0800 Subject: [PATCH] fix(test): narrow exception catch per Greptile P2 review --- .../messages/test_metadata_dict_copy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_metadata_dict_copy.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_metadata_dict_copy.py index 2bdb24799b6..92da50117fa 100644 --- a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_metadata_dict_copy.py +++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_metadata_dict_copy.py @@ -115,8 +115,8 @@ def test_non_dict_metadata_not_copied(): litellm_params=GenericLiteLLMParams(), headers={}, ) - except Exception: - # AnthropicMessagesRequest might reject non-dict metadata; that's fine. + except (TypeError, ValueError): + # AnthropicMessagesRequest may reject non-dict metadata; that's fine. # The point is the copy logic itself doesn't crash. pass