Skip to content

Commit f1f9efa

Browse files
committed
cleanup
1 parent 373400f commit f1f9efa

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

RELEASE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
Release type: patch
22

3-
Operations over `graphql-transport-ws` now create the Context and perform validation on
4-
the worker `Task`, thus not blocking the websocket from accepting messages.
3+
Fix error handling for query operations over graphql-transport-ws

tests/http/clients/litestar.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
)
3030

3131

32+
def custom_context_dependency() -> str:
33+
return "Hi!"
34+
35+
3236
async def litestar_get_context(request: Request = None):
3337
return get_context({"request": request})
3438

tests/websockets/test_graphql_transport_ws.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,8 @@
3030
from tests.http.clients.base import DebuggableGraphQLTransportWSHandler
3131
from tests.views.schema import MyExtension, Schema
3232

33-
from ..http.clients.base import WebSocketClient
34-
35-
try:
36-
from ..http.clients.fastapi import FastAPIHttpClient
37-
except ImportError: # pragma: no cover
38-
FastAPIHttpClient = None
39-
try:
40-
from ..http.clients.starlite import StarliteHttpClient
41-
except ImportError: # pragma: no cover
42-
StarliteHttpClient = None
43-
try:
44-
from ..http.clients.litestar import LitestarHttpClient
45-
except ImportError: # pragma: no cover
46-
LitestarHttpClient = None
47-
4833
if TYPE_CHECKING:
49-
from ..http.clients.base import HttpClient
34+
from ..http.clients.base import HttpClient, WebSocketClient
5035

5136

5237
@pytest_asyncio.fixture
@@ -912,6 +897,9 @@ async def test_error_handler_for_timeout(http_client: HttpClient):
912897

913898
if isinstance(http_client, ChannelsHttpClient):
914899
pytest.skip("Can't patch on_init for this client")
900+
901+
if not AsyncMock:
902+
pytest.skip("Don't have AsyncMock")
915903

916904
ws = ws_raw
917905
handler = None

0 commit comments

Comments
 (0)