Skip to content

Commit

Permalink
Bump pytest and pytest_asyncio
Browse files Browse the repository at this point in the history
  • Loading branch information
leszekhanusz committed Oct 21, 2023
1 parent 95b4603 commit 20c0861
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
1 change: 0 additions & 1 deletion docs/code_examples/console_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import logging

from aioconsole import ainput

from gql import Client, gql
from gql.transport.aiohttp import AIOHTTPTransport

Expand Down
1 change: 0 additions & 1 deletion docs/code_examples/fastapi_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from fastapi import FastAPI, HTTPException
from fastapi.responses import HTMLResponse

from gql import Client, gql
from gql.transport.aiohttp import AIOHTTPTransport

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

tests_requires = [
"parse==1.15.0",
"pytest==6.2.5",
"pytest-asyncio==0.16.0",
"pytest==7.4.2",
"pytest-asyncio==0.21.1",
"pytest-console-scripts==1.3.1",
"pytest-cov==3.0.0",
"mock==4.0.2",
Expand Down
17 changes: 9 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from typing import Union

import pytest
import pytest_asyncio

from gql import Client

Expand Down Expand Up @@ -101,13 +102,13 @@ async def go(app, *, port=None, **kwargs): # type: ignore
await servers.pop().close()


@pytest.fixture
@pytest_asyncio.fixture
async def aiohttp_server():
async for server in aiohttp_server_base():
yield server


@pytest.fixture
@pytest_asyncio.fixture
async def ssl_aiohttp_server():
async for server in aiohttp_server_base(with_ssl=True):
yield server
Expand Down Expand Up @@ -349,7 +350,7 @@ async def default_server_handler(ws, path):
return server_handler


@pytest.fixture
@pytest_asyncio.fixture
async def ws_ssl_server(request):
"""Websockets server fixture using SSL.
Expand All @@ -372,7 +373,7 @@ async def ws_ssl_server(request):
await test_server.stop()


@pytest.fixture
@pytest_asyncio.fixture
async def server(request):
"""Fixture used to start a dummy server to test the client behaviour.
Expand All @@ -395,7 +396,7 @@ async def server(request):
await test_server.stop()


@pytest.fixture
@pytest_asyncio.fixture
async def graphqlws_server(request):
"""Fixture used to start a dummy server with the graphql-ws protocol.
Expand Down Expand Up @@ -443,7 +444,7 @@ def process_subprotocol(self, headers, available_subprotocols):
await test_server.stop()


@pytest.fixture
@pytest_asyncio.fixture
async def client_and_server(server):
"""Helper fixture to start a server and a client connected to its port."""

Expand All @@ -460,7 +461,7 @@ async def client_and_server(server):
yield session, server


@pytest.fixture
@pytest_asyncio.fixture
async def client_and_graphqlws_server(graphqlws_server):
"""Helper fixture to start a server with the graphql-ws prototocol
and a client connected to its port."""
Expand All @@ -481,7 +482,7 @@ async def client_and_graphqlws_server(graphqlws_server):
yield session, graphqlws_server


@pytest.fixture
@pytest_asyncio.fixture
async def run_sync_test():
async def run_sync_test_inner(event_loop, server, test_function):
"""This function will run the test in a different Thread.
Expand Down
3 changes: 2 additions & 1 deletion tests/starwars/test_dsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ def test_use_variable_definition_multiple_times(ds):

assert (
print_ast(query)
== """mutation ($badReview: ReviewInput, $episode: Episode, $goodReview: ReviewInput) {
== """mutation \
($badReview: ReviewInput, $episode: Episode, $goodReview: ReviewInput) {
badReview: createReview(review: $badReview, episode: $episode) {
stars
commentary
Expand Down

0 comments on commit 20c0861

Please sign in to comment.