Skip to content

Commit fdeb916

Browse files
committed
Fix flaky tests by running them in isolation with pytest-forked
1 parent 22499d5 commit fdeb916

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

jupyter_server_nbmodel/tests/test_handlers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ async def fake_execute(client, ydoc, snippet, metadata, stdin_hook):
221221
assert "error" in results[uid], f"Expected an 'error' key in results[{uid!r}]"
222222
assert "simulated failure" in results[uid]["error"]
223223

224+
224225
@pytest.mark.timeout(TEST_TIMEOUT)
225226
async def test_execution_timing_metadata(jp_root_dir, jp_fetch, pending_kernel_is_ready, rtc_create_notebook, jp_serverapp):
226227
snippet = "a = 1"

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ test = [
4040
"pytest-cov",
4141
"pytest-jupyter[server]>=0.6",
4242
"pytest-timeout",
43+
"pytest-forked",
4344
"jupyter-server-ydoc[test]>=1.0.0b1",
4445
"jupyter-server-fileid",
4546
]
@@ -90,6 +91,7 @@ source_dir = "src"
9091
build_dir = "jupyter_server_nbmodel/labextension"
9192

9293
[tool.pytest.ini_options]
94+
addopts = "-vv --forked"
9395
filterwarnings = [
9496
"error",
9597
"ignore:Unclosed context <zmq.asyncio.Context:ResourceWarning",

0 commit comments

Comments
 (0)