Completely drop RootModel from types module (#1910)
This commit is contained in:
parent
f4672c5084
commit
5fdd48a0d3
1 changed files with 640 additions and 800 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue