From a1d0695c8ee62c6fae5496be57016f7ea951e5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Valur=20J=C3=B3nsson?= Date: Sat, 7 Sep 2024 13:18:32 +0000 Subject: [PATCH] ruff --- .../protocols/graphql_transport_ws/handlers.py | 7 +++---- tests/websockets/test_graphql_transport_ws.py | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py b/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py index d22838d506..94a8ca0903 100644 --- a/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +++ b/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py @@ -43,7 +43,6 @@ from strawberry.subscriptions.protocols.graphql_transport_ws.types import ( GraphQLTransportMessage, ) - class BaseGraphQLTransportWSHandler(ABC): @@ -294,9 +293,9 @@ async def single_result() -> AsyncIterator[ExecutionResult]: self.operations[message.id] = operation async def operation_task(self, operation: Operation) -> None: - """ - The operation task's top level method. Cleans-up and de-registers the operation - once it is done. + """The operation task's top level method. + + Cleans-up and de-registers the operation once it is done. """ task = asyncio.current_task() assert task is not None # for type checkers diff --git a/tests/websockets/test_graphql_transport_ws.py b/tests/websockets/test_graphql_transport_ws.py index 7de3c1664e..2b583110e1 100644 --- a/tests/websockets/test_graphql_transport_ws.py +++ b/tests/websockets/test_graphql_transport_ws.py @@ -1192,8 +1192,8 @@ async def op(*args: Any, **kwargs: Any): ).as_dict() ) - # wait for the error to be logged - while not wakeup: + # wait for the error to be logged. Must use timed loop and not event. + while not wakeup: # noqa: ASYNC110 await asyncio.sleep(0.01) # and another little bit, for the thread to finish await asyncio.sleep(0.01)