Skip to content

Commit 5a74d65

Browse files
fix: use importorskip for langgraph checkpoint import in tests
Avoids ty unresolved-import error in CI where langgraph is not installed. Uses pytest.importorskip instead of a direct import to stay consistent with the existing test_task_async.py pattern.
1 parent 86754d8 commit 5a74d65

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/test_build_subgraph.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,17 @@ class InputState:
103103
assert result["result"] == "done"
104104

105105
def test_with_checkpointer(self, state_cls: type):
106-
from langgraph.checkpoint.memory import InMemorySaver
106+
mem_mod = pytest.importorskip(
107+
"langgraph.checkpoint.memory",
108+
reason="langgraph checkpoint not installed",
109+
)
107110

108111
from evalwire.langgraph import build_subgraph
109112

110113
compiled = build_subgraph(
111114
nodes=[("n", lambda state: {"value": "x"})],
112115
state_cls=state_cls,
113-
checkpointer=InMemorySaver(),
116+
checkpointer=mem_mod.InMemorySaver(),
114117
)
115118
assert compiled is not None
116119

0 commit comments

Comments
 (0)