diff --git a/RELEASE.md b/RELEASE.md index 2820214c74..8f6812b821 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,4 +1,3 @@ Release type: patch -Operations over `graphql-transport-ws` now create the Context and perform validation on -the worker `Task`, thus not blocking the websocket from accepting messages. +Fix error handling for query operations over graphql-transport-ws \ No newline at end of file diff --git a/tests/http/clients/litestar.py b/tests/http/clients/litestar.py index b29be52b32..2548dc563c 100644 --- a/tests/http/clients/litestar.py +++ b/tests/http/clients/litestar.py @@ -29,6 +29,10 @@ ) +def custom_context_dependency() -> str: + return "Hi!" + + async def litestar_get_context(request: Request = None): return get_context({"request": request}) diff --git a/tests/websockets/test_graphql_transport_ws.py b/tests/websockets/test_graphql_transport_ws.py index e4cd0ad109..f996d0da33 100644 --- a/tests/websockets/test_graphql_transport_ws.py +++ b/tests/websockets/test_graphql_transport_ws.py @@ -30,23 +30,8 @@ from tests.http.clients.base import DebuggableGraphQLTransportWSHandler from tests.views.schema import MyExtension, Schema -from ..http.clients.base import WebSocketClient - -try: - from ..http.clients.fastapi import FastAPIHttpClient -except ImportError: # pragma: no cover - FastAPIHttpClient = None -try: - from ..http.clients.starlite import StarliteHttpClient -except ImportError: # pragma: no cover - StarliteHttpClient = None -try: - from ..http.clients.litestar import LitestarHttpClient -except ImportError: # pragma: no cover - LitestarHttpClient = None - if TYPE_CHECKING: - from ..http.clients.base import HttpClient + from ..http.clients.base import HttpClient, WebSocketClient @pytest_asyncio.fixture @@ -912,6 +897,9 @@ async def test_error_handler_for_timeout(http_client: HttpClient): if isinstance(http_client, ChannelsHttpClient): pytest.skip("Can't patch on_init for this client") + + if not AsyncMock: + pytest.skip("Don't have AsyncMock") ws = ws_raw handler = None