(code, expected)
| 64 | |
| 65 | ]) |
| 66 | def test_run_in_notebook(code, expected): |
| 67 | code = textwrap.dedent(code) |
| 68 | |
| 69 | t_start = time.time() |
| 70 | status, output, err = run_in_notebook(code, timeout=1) |
| 71 | duration = time.time() - t_start |
| 72 | assert status == expected, ( |
| 73 | f"Unexpected status: {status}, output: {output}, err: {err}, duration: {duration}" |
| 74 | ) |
| 75 | assert duration < 10, "Timeout not enforced properly" |
| 76 | if expected == "error": |
| 77 | assert "This is a test error" in err |
| 78 | |
| 79 | |
| 80 | def test_deterministic_payload_for_dynamic_func_in_notebook(): |
nothing calls this directly
no test coverage detected