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

Function test_batched_cells

tests/_runtime/test_pytest_runtime.py:77–97  ·  view source on GitHub ↗

Batch all non-isolation cells into a single run_pytest call.

(notebook_env)

Source from the content-addressed store, hash-verified

75
76@pytest.mark.skipif(sys.platform == "win32", reason="Fails on Windows CI")
77def test_batched_cells(notebook_env):
78 """Batch all non-isolation cells into a single run_pytest call."""
79 app, lcls, path, run_pytest = notebook_env
80
81 batch_defs: set[str] = set()
82 batch_expected = [0, 0, 0, 0] # passed, skipped, failed, errors
83 for cell in app._cell_manager.cells():
84 if cell and cell.__test__ and not (cell.defs & _ISOLATION_DEFS):
85 batch_defs.update(cell.defs)
86 for d in cell.defs:
87 for i, v in enumerate(_DEF_COUNT[d]):
88 batch_expected[i] += v
89
90 response = run_pytest(defs=batch_defs, lcls=lcls, notebook_path=path)
91 assert (
92 response.passed,
93 response.skipped,
94 response.failed,
95 response.errors,
96 ) == tuple(batch_expected), response.output
97 assert response.total == 28
98
99
100@pytest.mark.skipif(sys.platform == "win32", reason="Fails on Windows CI")

Callers

nothing calls this directly

Calls 3

run_pytestFunction · 0.90
updateMethod · 0.65
cellsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…