From 199ab464292e45db96b031a6693ffb309c1fb980 Mon Sep 17 00:00:00 2001 From: Tat Dat Duong Date: Mon, 10 Mar 2025 18:10:07 +0100 Subject: [PATCH] Avoid using checkpointer.list in async --- libs/langgraph/tests/test_pregel_async.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/langgraph/tests/test_pregel_async.py b/libs/langgraph/tests/test_pregel_async.py index b77cf39a4..e6f541ae7 100644 --- a/libs/langgraph/tests/test_pregel_async.py +++ b/libs/langgraph/tests/test_pregel_async.py @@ -7841,10 +7841,9 @@ async def test_handles_multiple_interrupts_from_tasks() -> None: @pytest.mark.parametrize("checkpointer_name", REGULAR_CHECKPOINTERS_ASYNC) -async def test_bulk_state_updates( - request: pytest.FixtureRequest, checkpointer_name: str -) -> None: +async def test_bulk_state_updates(checkpointer_name: str) -> None: async with awith_checkpointer(checkpointer_name) as checkpointer: + class State(TypedDict): foo: str baz: str @@ -7882,7 +7881,9 @@ async def test_bulk_state_updates( assert state.values == {"foo": "updated", "baz": "new"} # Check if there are only two checkpoints - checkpoints = list(checkpointer.list({"configurable": {"thread_id": "1"}})) + checkpoints = [ + c async for c in checkpointer.alist({"configurable": {"thread_id": "1"}}) + ] assert len(checkpoints) == 2 assert checkpoints[0].metadata["writes"] == { "node_a": {"foo": "updated"},