Enable test for doubly nested interrupts

This commit is contained in:
Nuno Campos
2024-08-29 15:49:43 -07:00
parent 8865831104
commit 4fc4080597
2 changed files with 12 additions and 22 deletions
-1
View File
@@ -8442,7 +8442,6 @@ def test_nested_graph_interrupts_parallel(
]
@pytest.mark.skip("TODO")
@pytest.mark.parametrize("checkpointer_name", ALL_CHECKPOINTERS_SYNC)
def test_doubly_nested_graph_interrupts(
request: pytest.FixtureRequest, checkpointer_name: str
+12 -21
View File
@@ -6888,17 +6888,11 @@ async def test_nested_graph_interrupts_parallel(
assert [
c async for c in app.astream({"my_key": ""}, config, stream_mode="values")
] == [
{
"my_key": "",
},
{"my_key": ""},
]
assert [c async for c in app.astream(None, config, stream_mode="values")] == [
{
"my_key": "got here and there and parallel",
},
{
"my_key": "got here and there and parallel and back again",
},
{"my_key": "got here and there and parallel"},
{"my_key": "got here and there and parallel and back again"},
]
# # test interrupts BEFORE the parallel node
@@ -6906,16 +6900,14 @@ async def test_nested_graph_interrupts_parallel(
config = {"configurable": {"thread_id": "4"}}
assert [
c async for c in app.astream({"my_key": ""}, config, stream_mode="values")
] == [{"my_key": ""}]
] == [
{"my_key": ""},
]
# while we're waiting for the node w/ interrupt inside to finish
assert [c async for c in app.astream(None, config, stream_mode="values")] == []
assert [c async for c in app.astream(None, config, stream_mode="values")] == [
{
"my_key": "got here and there and parallel",
},
{
"my_key": "got here and there and parallel and back again",
},
{"my_key": "got here and there and parallel"},
{"my_key": "got here and there and parallel and back again"},
]
# test interrupts AFTER the parallel node
@@ -6923,18 +6915,17 @@ async def test_nested_graph_interrupts_parallel(
config = {"configurable": {"thread_id": "5"}}
assert [
c async for c in app.astream({"my_key": ""}, config, stream_mode="values")
] == [{"my_key": ""}]
] == [
{"my_key": ""},
]
assert [c async for c in app.astream(None, config, stream_mode="values")] == [
{"my_key": "got here and there and parallel"},
]
assert [c async for c in app.astream(None, config, stream_mode="values")] == [
{
"my_key": "got here and there and parallel and back again",
},
{"my_key": "got here and there and parallel and back again"},
]
@pytest.mark.skip("TODO")
@pytest.mark.parametrize("checkpointer_name", ALL_CHECKPOINTERS_ASYNC)
async def test_doubly_nested_graph_interrupts(
request: pytest.FixtureRequest, checkpointer_name: str