Skip to content

Commit

Permalink
fixup! fixup! fix: session object was never used in aiohttp request (g…
Browse files Browse the repository at this point in the history
  • Loading branch information
greshilov committed Jun 2, 2021
1 parent baf7d0c commit a8137c9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions system_tests/system_tests_async/conftest.py
Expand Up @@ -26,9 +26,7 @@
from google.auth.transport import _aiohttp_requests as aiohttp_requests
from system_tests.system_tests_sync import conftest as sync_conftest

ASYNC_REQUESTS_SESSION = aiohttp.ClientSession(auto_decompress=False)

ASYNC_REQUESTS_SESSION.verify = False
TOKEN_INFO_URL = "https://www.googleapis.com/oauth2/v3/tokeninfo"


Expand All @@ -49,10 +47,18 @@ def authorized_user_file():
"""The full path to a valid authorized user file."""
yield sync_conftest.AUTHORIZED_USER_FILE


@pytest.fixture
async def aiohttp_session():
async with aiohttp.ClientSession(auto_decompress=False) as session:
yield session


@pytest.fixture(params=["aiohttp"])
async def http_request(request):
async def http_request(request, aiohttp_session):
"""A transport.request object."""
yield aiohttp_requests.Request(ASYNC_REQUESTS_SESSION)
yield aiohttp_requests.Request(aiohttp_session)


@pytest.fixture
async def token_info(http_request):
Expand Down

0 comments on commit a8137c9

Please sign in to comment.