Skip to content

Commit

Permalink
Fix aiohttp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jairhenrique committed Dec 28, 2024
1 parent 48d0a2e commit a6698ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/integration/test_aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pytest
import pytest_httpbin.certs
import yarl

import vcr

Expand Down Expand Up @@ -403,7 +404,7 @@ async def run(loop):
async with aiohttp.ClientSession(loop=loop, cookie_jar=aiohttp.CookieJar(unsafe=True)) as session:
cookies_resp = await session.get(cookies_url, ssl=HTTPBIN_SSL_CONTEXT)
assert not cookies_resp.cookies
cookies = session.cookie_jar.filter_cookies(cookies_url)
cookies = session.cookie_jar.filter_cookies(yarl.URL(cookies_url))
assert cookies["Cookie_1"].value == "Val_1"
assert cassette.play_count == 0

Expand All @@ -414,7 +415,7 @@ async def run(loop):
async with aiohttp.ClientSession(loop=loop, cookie_jar=aiohttp.CookieJar(unsafe=True)) as session:
cookies_resp = await session.get(cookies_url, ssl=HTTPBIN_SSL_CONTEXT)
assert not cookies_resp.cookies
cookies = session.cookie_jar.filter_cookies(cookies_url)
cookies = session.cookie_jar.filter_cookies(yarl.URL(cookies_url))
assert cookies["Cookie_1"].value == "Val_1"
assert cassette.play_count == 2

Expand All @@ -428,7 +429,7 @@ async def run(loop):
async with aiohttp.ClientSession(loop=loop, cookie_jar=aiohttp.CookieJar(unsafe=True)) as session:
cookies_resp = await session.get(cookies_url, ssl=HTTPBIN_SSL_CONTEXT)
assert not cookies_resp.cookies
cookies = session.cookie_jar.filter_cookies(cookies_url)
cookies = session.cookie_jar.filter_cookies(yarl.URL(cookies_url))
assert cookies["Cookie_1"].value == "Val_1"

run_in_loop(run)
Expand Down

0 comments on commit a6698ed

Please sign in to comment.