Skip to content

Commit

Permalink
wip: updating tests to follow AIOHTTPWebsockets protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
Taylor Lowery committed Jun 4, 2024
1 parent ef84507 commit 9870336
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion gql/transport/aiohttp_websockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def __init__(
ping_interval: Optional[Union[int, float]] = None,
pong_timeout: Optional[Union[int, float]] = None,
answer_pings: bool = True,

) -> None:
self.url: StrOrURL = url
self.headers: Optional[LooseHeaders] = headers
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ async def client_and_server(server):
async with Client(transport=sample_transport) as session:

# Yield both client session and server
yield session, server@pytest_asyncio.fixture
yield session, server

@pytest_asyncio.fixture
async def aiohttp_client_and_server(server):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_aiohttp_websocket_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ async def test_aiohttp_websocket_sending_invalid_data(

invalid_data = "QSDF"
print(f">>> {invalid_data}")
await session.transport.websocket.send(invalid_data)
await session.transport.websocket.send_str(invalid_data)

await asyncio.sleep(2 * MS)

Expand Down Expand Up @@ -313,7 +313,7 @@ async def test_aiohttp_websocket_server_closing_after_ack(

query = gql("query { hello }")

with pytest.raises(websockets.exceptions.ConnectionClosed):
with pytest.raises(ConnectionResetError):
await session.execute(query)

await session.transport.wait_closed()
Expand Down
Empty file.

0 comments on commit 9870336

Please sign in to comment.