Skip to content

Commit 41ac446

Browse files
committed
formatting
1 parent 49cbc29 commit 41ac446

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/shared/test_streamable_http.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ async def handle_call_tool(name: str, args: dict) -> list[TextContent]:
172172
related_request_id=ctx.request_id, # need for stream association
173173
)
174174

175-
# need to wait for long enough that the client can reliably stop the tool before this finishes
175+
# need to wait for long enough that the client can
176+
# reliably stop the tool before this finishes
176177
await anyio.sleep(0.3)
177178

178179
await ctx.session.send_log_message(
@@ -182,7 +183,9 @@ async def handle_call_tool(name: str, args: dict) -> list[TextContent]:
182183
related_request_id=ctx.request_id,
183184
)
184185

185-
# Adding another message just to make it even less likely that this tool will exit before the client can stop it
186+
# Adding another message just to make it even less
187+
# likely that this tool will exit before the client
188+
# can stop it
186189
await anyio.sleep(0.3)
187190

188191
await ctx.session.send_log_message(
@@ -1111,7 +1114,8 @@ async def run_tool():
11111114
tg.cancel_scope.cancel()
11121115

11131116
# Make sure we only have one notification.. otherwise the test is flaky
1114-
# More than one notification means the tool likely could have finished already and will not call the message handler again upon resumption
1117+
# More than one notification means the tool likely could have finished
1118+
# already and will not call the message handler again upon resumption
11151119
assert len(captured_notifications) == 1
11161120

11171121
# Store pre notifications and clear the captured notifications
@@ -1140,7 +1144,9 @@ async def run_tool():
11401144
metadata = ClientMessageMetadata(
11411145
resumption_token=captured_resumption_token,
11421146
)
1143-
# We need to wait for the tool to send another message so this doesn't deadlock. Fixing is out of scope for this PR. More details in https://github.com/modelcontextprotocol/python-sdk/issues/860
1147+
# We need to wait for the tool to send another message so this doesn't
1148+
# deadlock. Fixing is out of scope for this PR. More details in
1149+
# https://github.com/modelcontextprotocol/python-sdk/issues/860
11441150
await anyio.sleep(0.2)
11451151
result = await session.send_request(
11461152
types.ClientRequest(
@@ -1155,7 +1161,6 @@ async def run_tool():
11551161
metadata=metadata,
11561162
)
11571163

1158-
11591164
# We should get a complete result
11601165
assert len(result.content) == 1
11611166
assert result.content[0].type == "text"

0 commit comments

Comments
 (0)