Completely drop RootModel from types module (#1910)

This commit is contained in:
Marcelo Trylesinski 2026-01-19 14:29:15 +01:00 • committed by GitHub
commit 5fdd48a0d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -135,8 +135,8 @@ async def test_bidirectional_progress_notifications():
raise message
if isinstance(message, types.ServerNotification): # pragma: no branch
if isinstance(message.root, types.ProgressNotification): # pragma: no branch
params = message.root.params
if isinstance(message, types.ProgressNotification): # pragma: no branch
params = message.params
client_progress_updates.append(
{
"token": params.progress_token,
@ -332,7 +332,7 @@ async def test_progress_callback_exception_logging():
# Track logged warnings
logged_errors: list[str] = []
def mock_log_error(msg: str, *args: Any) -> None:
def mock_log_exception(msg: str, *args: Any, **kwargs: Any) -> None:
logged_errors.append(msg % args if args else msg)
# Create a progress callback that raises an exception
@ -368,7 +368,7 @@ async def test_progress_callback_exception_logging():
]
# Test with mocked logging
with patch("mcp.shared.session.logging.error", side_effect=mock_log_error):
with patch("mcp.shared.session.logging.exception", side_effect=mock_log_exception):
async with Client(server) as client:
# Call tool with a failing progress callback
result = await client.call_tool(