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)