From b98a7b09a3989410c7121d7c8dc04733ac494e4b Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Thu, 16 Jan 2025 13:43:47 -0800 Subject: [PATCH] Update --- .../tests/__snapshots__/test_pregel.ambr | 85 +++++++++++++++++++ libs/langgraph/tests/test_pregel.py | 12 +-- 2 files changed, 89 insertions(+), 8 deletions(-) diff --git a/libs/langgraph/tests/__snapshots__/test_pregel.ambr b/libs/langgraph/tests/__snapshots__/test_pregel.ambr index 67cb0f852..9c2f2549b 100644 --- a/libs/langgraph/tests/__snapshots__/test_pregel.ambr +++ b/libs/langgraph/tests/__snapshots__/test_pregel.ambr @@ -3627,6 +3627,91 @@ ''' # --- +# name: test_interrupt_functional[postgres] + ''' + %%{init: {'flowchart': {'curve': 'linear'}}}%% + graph TD; + __graph(graph) + __bar(bar) + __foo(foo) + __graph -.-> __bar; + __bar --> __graph; + __graph -.-> __foo; + __foo --> __graph; + classDef default fill:#f2f0ff,line-height:1.2 + classDef first fill-opacity:0 + classDef last fill:#bfb6fc + + ''' +# --- +# name: test_interrupt_functional[postgres_pipe] + ''' + %%{init: {'flowchart': {'curve': 'linear'}}}%% + graph TD; + __graph(graph) + __bar(bar) + __foo(foo) + __graph -.-> __bar; + __bar --> __graph; + __graph -.-> __foo; + __foo --> __graph; + classDef default fill:#f2f0ff,line-height:1.2 + classDef first fill-opacity:0 + classDef last fill:#bfb6fc + + ''' +# --- +# name: test_interrupt_functional[postgres_pool] + ''' + %%{init: {'flowchart': {'curve': 'linear'}}}%% + graph TD; + __graph(graph) + __bar(bar) + __foo(foo) + __graph -.-> __bar; + __bar --> __graph; + __graph -.-> __foo; + __foo --> __graph; + classDef default fill:#f2f0ff,line-height:1.2 + classDef first fill-opacity:0 + classDef last fill:#bfb6fc + + ''' +# --- +# name: test_interrupt_functional[postgres_shallow] + ''' + %%{init: {'flowchart': {'curve': 'linear'}}}%% + graph TD; + __graph(graph) + __bar(bar) + __foo(foo) + __graph -.-> __bar; + __bar --> __graph; + __graph -.-> __foo; + __foo --> __graph; + classDef default fill:#f2f0ff,line-height:1.2 + classDef first fill-opacity:0 + classDef last fill:#bfb6fc + + ''' +# --- +# name: test_interrupt_functional[sqlite] + ''' + %%{init: {'flowchart': {'curve': 'linear'}}}%% + graph TD; + __graph(graph) + __bar(bar) + __foo(foo) + __graph -.-> __bar; + __bar --> __graph; + __graph -.-> __foo; + __foo --> __graph; + classDef default fill:#f2f0ff,line-height:1.2 + classDef first fill-opacity:0 + classDef last fill:#bfb6fc + + ''' +# --- # name: test_interrupt_task_functional[memory] ''' %%{init: {'flowchart': {'curve': 'linear'}}}%% diff --git a/libs/langgraph/tests/test_pregel.py b/libs/langgraph/tests/test_pregel.py index e941de088..72c4adfb9 100644 --- a/libs/langgraph/tests/test_pregel.py +++ b/libs/langgraph/tests/test_pregel.py @@ -1546,8 +1546,7 @@ def test_imp_stream_order( fut_baz = baz(fut_bar.result()) return fut_baz.result() - if checkpointer_name == "memory": - assert graph.get_graph().draw_mermaid() == snapshot + assert graph.get_graph().draw_mermaid() == snapshot thread1 = {"configurable": {"thread_id": "1"}} assert [c for c in graph.stream({"a": "0"}, thread1)] == [ @@ -5009,8 +5008,7 @@ def test_interrupt_task_functional( fut_bar = bar(fut_foo.result()) return fut_bar.result() - if checkpointer_name == "memory": - assert graph.get_graph().draw_mermaid() == snapshot + assert graph.get_graph().draw_mermaid() == snapshot config = {"configurable": {"thread_id": "1"}} # First run, interrupted at bar @@ -5456,8 +5454,7 @@ def test_falsy_return_from_task( falsy_task().result() interrupt("test") - if checkpointer_name == "memory": - assert graph.get_graph().draw_mermaid() == snapshot + assert graph.get_graph().draw_mermaid() == snapshot configurable = {"configurable": {"thread_id": str(uuid.uuid4())}} graph.invoke({"a": 5}, configurable) @@ -5491,8 +5488,7 @@ def test_multiple_interrupts_imperative( return {"values": values} - if checkpointer_name == "memory": - assert graph.get_graph().draw_mermaid() == snapshot + assert graph.get_graph().draw_mermaid() == snapshot configurable = {"configurable": {"thread_id": str(uuid.uuid4())}} graph.invoke({}, configurable)