From 8ce30b71f4217a9c81d126f18ad70cc50f7f90c7 Mon Sep 17 00:00:00 2001 From: Omar Abdelwahab Date: Fri, 7 Nov 2025 10:52:40 -0800 Subject: [PATCH] test: update error message match for authorization validation Updated test_mcp_authorization_error_when_header_provided to match the new validation error message from the Pydantic validator. --- tests/integration/responses/test_mcp_authentication.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/responses/test_mcp_authentication.py b/tests/integration/responses/test_mcp_authentication.py index a61de512c..0fb0da945 100644 --- a/tests/integration/responses/test_mcp_authentication.py +++ b/tests/integration/responses/test_mcp_authentication.py @@ -70,7 +70,7 @@ def test_mcp_authorization_different_token(compat_client, text_model_id): "type": "mcp", "server_label": "auth2-mcp", "server_url": "", - "authorization": test_token, # Just the token, not "Bearer " + "authorization": test_token, } ], mcp_server_info, @@ -112,7 +112,7 @@ def test_mcp_authorization_error_when_header_provided(compat_client, text_model_ # Create response - should raise ValueError for security reasons with pytest.raises( - ValueError, match="For security reasons, Authorization header cannot be passed via 'headers'" + ValueError, match="Authorization header cannot be passed via 'headers'" ): compat_client.responses.create( model=text_model_id,