Skip to content

Commit 5f96350

Browse files
committed
-
1 parent af9a1be commit 5f96350

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tests/conftest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ async def yws_server(request):
4343
@pytest.fixture
4444
def yjs_client(request):
4545
client_id = request.param
46-
p = subprocess.Popen(f"yarn node {here / 'yjs_client_'}{client_id}.js", shell=True)
46+
p = subprocess.Popen(["node", f"{here / 'yjs_client_'}{client_id}.js"])
4747
yield p
48-
p.kill()
48+
p.terminate()
49+
try:
50+
p.wait(timeout=10)
51+
except Exception:
52+
p.kill()

tests/test_pycrdt_yjs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ async def test_ypy_yjs_0(yws_server, yjs_client):
7979
async def test_ypy_yjs_1(yws_server, yjs_client):
8080
ydoc = Doc()
8181
ynotebook = YNotebook(ydoc)
82+
nb = stringify_source(json.loads((files_dir / "nb1.ipynb").read_text()))
83+
ynotebook.source = nb
8284
async with connect("ws://localhost:1234/my-roomname") as websocket, WebsocketProvider(
8385
ydoc, websocket
8486
):
85-
nb = stringify_source(json.loads((files_dir / "nb1.ipynb").read_text()))
86-
ynotebook.source = nb
8787
output_text = ynotebook.ycells[0]["outputs"][0]["text"]
8888
assert output_text.to_py() == ["Hello,"]
8989
event = Event()

0 commit comments

Comments
 (0)