Skip to content

Commit 2fb900d

Browse files
andylim-duoclaude
andcommitted
fix: formatting and coverage for CI
- Add missing blank line after merge_contexts (pre-commit) - Remove try/finally in test to fix branch coverage gap Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b87f7b1 commit 2fb900d

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/mcp/shared/_context.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def _build() -> contextvars.Context:
3333

3434
return sender_context.run(_build)
3535

36+
3637
SessionT = TypeVar("SessionT", bound=BaseSession[Any, Any, Any, Any, Any])
3738

3839

tests/server/mcpserver/test_multi_tenancy_e2e.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,11 @@ async def run_server() -> None:
373373
tg.start_soon(run_server)
374374

375375
# Set a client-side contextvar before sending the request
376-
client_token = _CLIENT_VAR.set("hello-from-client")
377-
try:
378-
async with ClientSession(client_read, client_write) as session:
379-
await session.initialize()
380-
await session.call_tool("probe", {})
381-
finally:
382-
_CLIENT_VAR.reset(client_token)
376+
_CLIENT_VAR.set("hello-from-client")
377+
378+
async with ClientSession(client_read, client_write) as session:
379+
await session.initialize()
380+
await session.call_tool("probe", {})
383381

384382
tg.cancel_scope.cancel() # pragma: lax no cover
385383

0 commit comments

Comments
 (0)