Batch all non-isolation cells into a single run_pytest call.
(notebook_env)
| 75 | |
| 76 | @pytest.mark.skipif(sys.platform == "win32", reason="Fails on Windows CI") |
| 77 | def 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") |
nothing calls this directly
no test coverage detected
searching dependent graphs…