@@ -52,12 +52,6 @@ async def ws(ws_raw: WebSocketClient) -> AsyncGenerator[WebSocketClient, None]:
5252 assert ws .closed
5353
5454
55- # convenience fixture to use previous name
56- @pytest .fixture
57- def aiohttp_app_client (http_client : HttpClient ) -> HttpClient :
58- return http_client
59-
60-
6155async def test_simple_subscription (ws : WebSocketClient ):
6256 await ws .send_legacy_message (
6357 {
@@ -292,9 +286,9 @@ async def test_context_can_be_modified_from_within_on_ws_connect(
292286 assert ws_raw .closed
293287
294288
295- async def test_sends_keep_alive (aiohttp_app_client : HttpClient ):
296- aiohttp_app_client .create_app (keep_alive = True , keep_alive_interval = 0.1 )
297- async with aiohttp_app_client .ws_connect (
289+ async def test_sends_keep_alive (http_client : HttpClient ):
290+ http_client .create_app (keep_alive = True , keep_alive_interval = 0.1 )
291+ async with http_client .ws_connect (
298292 "/graphql" , protocols = [GRAPHQL_WS_PROTOCOL ]
299293 ) as ws :
300294 await ws .send_legacy_message ({"type" : "connection_init" })
@@ -655,15 +649,15 @@ async def test_resolving_enums(ws: WebSocketClient):
655649
656650
657651@pytest .mark .xfail (reason = "flaky test" )
658- async def test_task_cancellation_separation (aiohttp_app_client : HttpClient ):
652+ async def test_task_cancellation_separation (http_client : HttpClient ):
659653 # Note Python 3.7 does not support Task.get_name/get_coro so we have to use
660654 # repr(Task) to check whether expected tasks are running.
661655 # This only works for aiohttp, where we are using the same event loop
662656 # on the client side and server.
663657 try :
664658 from tests .http .clients .aiohttp import AioHttpClient
665659
666- aio = aiohttp_app_client == AioHttpClient # type: ignore
660+ aio = http_client == AioHttpClient # type: ignore
667661 except ImportError :
668662 aio = False
669663
@@ -674,12 +668,8 @@ def get_result_handler_tasks():
674668 if "BaseGraphQLWSHandler.handle_async_results" in repr (task )
675669 ]
676670
677- connection1 = aiohttp_app_client .ws_connect (
678- "/graphql" , protocols = [GRAPHQL_WS_PROTOCOL ]
679- )
680- connection2 = aiohttp_app_client .ws_connect (
681- "/graphql" , protocols = [GRAPHQL_WS_PROTOCOL ]
682- )
671+ connection1 = http_client .ws_connect ("/graphql" , protocols = [GRAPHQL_WS_PROTOCOL ])
672+ connection2 = http_client .ws_connect ("/graphql" , protocols = [GRAPHQL_WS_PROTOCOL ])
683673
684674 async with connection1 as ws1 , connection2 as ws2 :
685675 start_message : StartMessage = {
@@ -748,8 +738,8 @@ def get_result_handler_tasks():
748738 assert complete_message ["id" ] == "debug1"
749739
750740
751- async def test_injects_connection_params (aiohttp_app_client : HttpClient ):
752- async with aiohttp_app_client .ws_connect (
741+ async def test_injects_connection_params (http_client : HttpClient ):
742+ async with http_client .ws_connect (
753743 "/graphql" , protocols = [GRAPHQL_WS_PROTOCOL ]
754744 ) as ws :
755745 await ws .send_legacy_message (
@@ -791,8 +781,8 @@ async def test_injects_connection_params(aiohttp_app_client: HttpClient):
791781 assert ws .closed
792782
793783
794- async def test_rejects_connection_params (aiohttp_app_client : HttpClient ):
795- async with aiohttp_app_client .ws_connect (
784+ async def test_rejects_connection_params (http_client : HttpClient ):
785+ async with http_client .ws_connect (
796786 "/graphql" , protocols = [GRAPHQL_WS_PROTOCOL ]
797787 ) as ws :
798788 await ws .send_json (
@@ -813,9 +803,9 @@ async def test_rejects_connection_params(aiohttp_app_client: HttpClient):
813803
814804@mock .patch .object (MyExtension , MyExtension .get_results .__name__ , return_value = {})
815805async def test_no_extensions_results_wont_send_extensions_in_payload (
816- mock : mock .MagicMock , aiohttp_app_client : HttpClient
806+ mock : mock .MagicMock , http_client : HttpClient
817807):
818- async with aiohttp_app_client .ws_connect (
808+ async with http_client .ws_connect (
819809 "/graphql" , protocols = [GRAPHQL_WS_PROTOCOL ]
820810 ) as ws :
821811 await ws .send_legacy_message ({"type" : "connection_init" })
0 commit comments