MCPcopy
hub / github.com/marimo-team/marimo / test_three_node_cycle

Function test_three_node_cycle

tests/_lint/test_validate_graph.py:124–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122
123
124def test_three_node_cycle() -> None:
125 graph = dataflow.DirectedGraph()
126 graph.register_cell("0", parse_cell("x = y"))
127 graph.register_cell("1", parse_cell("y = z"))
128 graph.register_cell("2", parse_cell("z = x"))
129 errors = check_for_errors(graph)
130 assert set(errors.keys()) == {"0", "1", "2"}
131 for t in errors.values():
132 assert len(t) == 1
133 assert isinstance(t[0], CycleError)
134 edges_with_vars = t[0].edges_with_vars
135 assert len(edges_with_vars) == 3
136 assert ("0", ("x",), "2") in edges_with_vars
137 assert ("1", ("y",), "0") in edges_with_vars
138 assert ("2", ("z",), "1") in edges_with_vars
139
140
141def test_cycle_and_multiple_def() -> None:

Callers

nothing calls this directly

Calls 4

register_cellMethod · 0.95
check_for_errorsFunction · 0.90
keysMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…