From 5abc79fb438c25498e932b0654cdb1720330e435 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 08:09:46 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/conftest.py | 10 +++++----- tests/test_asgi.py | 4 +--- tests/test_pycrdt_yjs.py | 6 ++---- tests/test_ystore.py | 1 - 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index fd9544e..cb5c840 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,15 +2,13 @@ import pytest from anyio import Event, create_task_group -from pycrdt import Array, Doc -from websockets import serve from hypercorn import Config +from pycrdt import Array, Doc from sniffio import current_async_library +from utils import ensure_server_running from pycrdt_websocket import ASGIServer, WebsocketServer -from utils import ensure_server_running - class TestYDoc: def __init__(self): @@ -44,7 +42,9 @@ async def yws_server(request, unused_tcp_port): from hypercorn.asyncio import serve try: async with create_task_group() as tg, websocket_server: - tg.start_soon(partial(serve, app, config, shutdown_trigger=shutdown_event.wait, mode="asgi")) + tg.start_soon( + partial(serve, app, config, shutdown_trigger=shutdown_event.wait, mode="asgi") + ) await ensure_server_running("localhost", unused_tcp_port) yield unused_tcp_port shutdown_event.set() diff --git a/tests/test_asgi.py b/tests/test_asgi.py index bae9831..901a7cb 100644 --- a/tests/test_asgi.py +++ b/tests/test_asgi.py @@ -2,11 +2,9 @@ from anyio import sleep from httpx_ws import aconnect_ws from pycrdt import Doc, Map - -from pycrdt_websocket import WebsocketProvider - from utils import Websocket +from pycrdt_websocket import WebsocketProvider pytestmark = pytest.mark.anyio diff --git a/tests/test_pycrdt_yjs.py b/tests/test_pycrdt_yjs.py index 43393f7..8950b53 100644 --- a/tests/test_pycrdt_yjs.py +++ b/tests/test_pycrdt_yjs.py @@ -4,13 +4,11 @@ import pytest from anyio import Event, fail_after -from pycrdt import Array, Doc, Map from httpx_ws import aconnect_ws - -from pycrdt_websocket import WebsocketProvider - +from pycrdt import Array, Doc, Map from utils import Websocket, yjs_client +from pycrdt_websocket import WebsocketProvider pytestmark = pytest.mark.anyio diff --git a/tests/test_ystore.py b/tests/test_ystore.py index c6cd4d6..f94c190 100644 --- a/tests/test_ystore.py +++ b/tests/test_ystore.py @@ -9,7 +9,6 @@ from pycrdt_websocket.ystore import SQLiteYStore, TempFileYStore - pytestmark = pytest.mark.anyio