Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanvalur committed Oct 13, 2024
1 parent 373400f commit f1f9efa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
3 changes: 1 addition & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions tests/http/clients/litestar.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
)


def custom_context_dependency() -> str:
return "Hi!"


async def litestar_get_context(request: Request = None):
return get_context({"request": request})

Expand Down
20 changes: 4 additions & 16 deletions tests/websockets/test_graphql_transport_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f1f9efa

Please sign in to comment.