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