Skip to content

Commit 58e1c66

Browse files
committed
Add type ignore comments for test mocks
1 parent 452dfb9 commit 58e1c66

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/server/test_cancel_handling.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def respond(self, response):
2828

2929
def cancel(self):
3030
"""Simulate the cancel() method sending an error response."""
31-
asyncio.create_task(self.send(ServerResult(error=types.ErrorData(code=-32800, message="Request cancelled"))))
31+
asyncio.create_task(self.send(types.ErrorData(code=-32800, message="Request cancelled")))
3232

3333

3434
@pytest.mark.anyio
@@ -67,7 +67,7 @@ async def slow_handler(req):
6767

6868
# Start the request
6969
handle_task = asyncio.create_task(
70-
server._handle_request(mock_message, mock_req, mock_session, mock_context, raise_exceptions=False)
70+
server._handle_request(mock_message, mock_req, mock_session, mock_context, raise_exceptions=False) # type: ignore
7171
)
7272

7373
# Give it time to start
@@ -112,7 +112,7 @@ async def fast_handler(req):
112112
mock_req1 = PingRequest(method="ping", params={})
113113

114114
handle_task = asyncio.create_task(
115-
server._handle_request(mock_message1, mock_req1, MagicMock(), None, raise_exceptions=False)
115+
server._handle_request(mock_message1, mock_req1, MagicMock(), None, raise_exceptions=False) # type: ignore
116116
)
117117

118118
await asyncio.sleep(0.1)
@@ -132,7 +132,7 @@ async def fast_handler(req):
132132
mock_req2 = PingRequest(method="ping", params={})
133133

134134
# This should complete successfully
135-
await server._handle_request(mock_message2, mock_req2, MagicMock(), None, raise_exceptions=False)
135+
await server._handle_request(mock_message2, mock_req2, MagicMock(), None, raise_exceptions=False) # type: ignore
136136

137137
# Server handled the second request successfully
138138
assert mock_message2._responded

0 commit comments

Comments
 (0)