From 005edb297980e1fa7bbc2d7216d0acda7ce7f3bd Mon Sep 17 00:00:00 2001 From: Tat Dat Duong Date: Thu, 26 Jun 2025 01:12:37 +0200 Subject: [PATCH] Async test --- libs/langgraph/tests/test_pregel_async.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/libs/langgraph/tests/test_pregel_async.py b/libs/langgraph/tests/test_pregel_async.py index 3ab761db9..b2d75456d 100644 --- a/libs/langgraph/tests/test_pregel_async.py +++ b/libs/langgraph/tests/test_pregel_async.py @@ -860,7 +860,9 @@ async def test_dynamic_interrupt_subgraph( @NEEDS_CONTEXTVARS -async def test_copy_checkpoint(async_checkpointer: BaseCheckpointSaver) -> None: +async def test_partial_pending_checkpoint( + async_checkpointer: BaseCheckpointSaver, +) -> None: class State(TypedDict): my_key: Annotated[str, operator.add] market: str @@ -1017,31 +1019,27 @@ async def test_copy_checkpoint(async_checkpointer: BaseCheckpointSaver) -> None: ) # clear the interrupt and next tasks - await tool_two.aupdate_state(thread1, None, as_node="__copy__") - # interrupt is cleared, next task is kept + await tool_two.aupdate_state(thread1, None, as_node=END) + # interrupt and next tasks are cleared, finished tasks are kept tup = await tool_two.checkpointer.aget_tuple(thread1) assert await tool_two.aget_state(thread1) == StateSnapshot( values={"my_key": "value ⛰️", "market": "DE"}, - next=("tool_one", "tool_two"), + next=("tool_one",), tasks=( PregelTask( AnyStr(), "tool_one", (PUSH, 0, False), - result=None, - ), - PregelTask( - AnyStr(), - "tool_two", - (PULL, "tool_two"), + error=None, interrupts=(), + state=None, ), ), config=tup.config, created_at=tup.checkpoint["ts"], metadata={ "parents": {}, - "source": "fork", + "source": "update", "step": 1, }, parent_config=(