Skip to content

Commit 2590802

Browse files
fix: update task tests to use session_lifespan parameter
ROOT CAUSE: The experimental task tests were using the old 'lifespan' parameter which was renamed to 'session_lifespan' in the lifespan redesign. CHANGES: - Updated tests/experimental/tasks/server/test_integration.py - Updated tests/experimental/tasks/client/test_tasks.py - Changed Server() calls from lifespan= to session_lifespan= IMPACT: - Fixes test failures in experimental/tasks/ directory - All 217 task tests now pass Github-Issue:#2113
1 parent f8d8267 commit 2590802

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/experimental/tasks/client/test_tasks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ async def handle_get_task(ctx: ServerRequestContext[AppContext], params: GetTask
102102

103103
server: Server[AppContext] = Server(
104104
"test-server",
105-
lifespan=_make_lifespan(store, task_done_events),
105+
session_lifespan=_make_lifespan(store, task_done_events),
106106
on_list_tools=_handle_list_tools,
107107
on_call_tool=_handle_call_tool_with_done_event,
108108
)
@@ -153,7 +153,7 @@ async def handle_get_task_result(
153153

154154
server: Server[AppContext] = Server(
155155
"test-server",
156-
lifespan=_make_lifespan(store, task_done_events),
156+
session_lifespan=_make_lifespan(store, task_done_events),
157157
on_list_tools=_handle_list_tools,
158158
on_call_tool=handle_call_tool,
159159
)
@@ -200,7 +200,7 @@ async def handle_list_tasks(
200200

201201
server: Server[AppContext] = Server(
202202
"test-server",
203-
lifespan=_make_lifespan(store, task_done_events),
203+
session_lifespan=_make_lifespan(store, task_done_events),
204204
on_list_tools=_handle_list_tools,
205205
on_call_tool=_handle_call_tool_with_done_event,
206206
)
@@ -277,7 +277,7 @@ async def handle_cancel_task(
277277

278278
server: Server[AppContext] = Server(
279279
"test-server",
280-
lifespan=_make_lifespan(store, task_done_events),
280+
session_lifespan=_make_lifespan(store, task_done_events),
281281
on_list_tools=_handle_list_tools,
282282
on_call_tool=handle_call_tool_no_work,
283283
)

tests/experimental/tasks/server/test_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ async def handle_list_tasks(
123123

124124
server: Server[AppContext] = Server(
125125
"test-tasks",
126-
lifespan=_make_lifespan(store, task_done_events),
126+
session_lifespan=_make_lifespan(store, task_done_events),
127127
on_list_tools=handle_list_tools,
128128
on_call_tool=handle_call_tool,
129129
)
@@ -216,7 +216,7 @@ async def handle_get_task(ctx: ServerRequestContext[AppContext], params: GetTask
216216

217217
server: Server[AppContext] = Server(
218218
"test-tasks-failure",
219-
lifespan=_make_lifespan(store, task_done_events),
219+
session_lifespan=_make_lifespan(store, task_done_events),
220220
on_list_tools=handle_list_tools,
221221
on_call_tool=handle_call_tool,
222222
)

0 commit comments

Comments
 (0)