diff --git a/tests/test_yroom.py b/tests/test_yroom.py index e7398ba..cc9da59 100644 --- a/tests/test_yroom.py +++ b/tests/test_yroom.py @@ -1,13 +1,14 @@ -from pycrdt_websocket.yroom import YRoom import pytest -from anyio.abc import TaskStatus from anyio import TASK_STATUS_IGNORED, sleep +from anyio.abc import TaskStatus from pycrdt import Map from pycrdt_websocket import exception_logger +from pycrdt_websocket.yroom import YRoom pytestmark = pytest.mark.anyio + @pytest.mark.parametrize("websocket_server_api", ["websocket_server_start_stop"], indirect=True) @pytest.mark.parametrize("yws_server", [{"exception_handler": exception_logger}], indirect=True) async def test_yroom_restart(yws_server, yws_provider): @@ -19,14 +20,12 @@ async def raise_error(task_status: TaskStatus[None] = TASK_STATUS_IGNORED): raise RuntimeError("foo") yroom.ydoc = yws_provider - await server.start_room(yroom) + await server.start_room(yroom) yroom.ydoc["map"] = ymap1 = Map() - ymap1["key"] = "value" + ymap1["key"] = "value" await yroom._task_group.start(raise_error) - ymap1["key2"] = "value2" + ymap1["key2"] = "value2" await sleep(0.1) assert yroom._task_group is not None assert not yroom._task_group.cancel_scope.cancel_called await yroom.stop() - -