Switch RFC7523OAuthClientProvider warning to MCPDeprecationWarning (#2996)

This commit is contained in:
Marcelo Trylesinski 2026-06-26 15:27:57 +02:00 • committed by GitHub
commit cc596195bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,6 +14,7 @@ from mcp.client.auth.extensions.client_credentials import (
static_assertion_provider,
)
from mcp.shared.auth import OAuthClientInformationFull, OAuthClientMetadata, OAuthToken
from mcp.shared.exceptions import MCPDeprecationWarning
# See test_index.py for why this is a per-module mark and not a conftest hook.
pytestmark = [pytest.mark.anyio, pytest.mark.filterwarnings("error::mcp.MCPDeprecationWarning")]
@ -105,7 +106,7 @@ async def test_the_one_more_provider_is_private_key_jwt() -> None:
async def test_the_page_does_not_count_the_deprecated_provider() -> None:
"""Why the `!!! info` says *one* more provider: `RFC7523OAuthClientProvider` warns on construction."""
with pytest.warns(DeprecationWarning, match="RFC7523OAuthClientProvider is deprecated"):
with pytest.warns(MCPDeprecationWarning, match="RFC7523OAuthClientProvider is deprecated"):
RFC7523OAuthClientProvider(
server_url="http://localhost:8001/mcp",
client_metadata=tutorial001.oauth.context.client_metadata,