diff --git a/tests/integration/test_aiohttp.py b/tests/integration/test_aiohttp.py index bbb0913..8f3b743 100644 --- a/tests/integration/test_aiohttp.py +++ b/tests/integration/test_aiohttp.py @@ -56,6 +56,8 @@ def test_headers(tmpdir, scheme): cassette_response, _ = get(url) assert cassette_response.headers == response.headers assert cassette.play_count == 1 + assert 'istr' not in cassette.data[0] + assert 'yarl.URL' not in cassette.data[0] def test_text(tmpdir, scheme): diff --git a/vcr/stubs/aiohttp_stubs/__init__.py b/vcr/stubs/aiohttp_stubs/__init__.py index 237ddea..6de1c17 100644 --- a/vcr/stubs/aiohttp_stubs/__init__.py +++ b/vcr/stubs/aiohttp_stubs/__init__.py @@ -98,9 +98,9 @@ def vcr_request(cassette, real_request): 'code': response.status, 'message': response.reason, }, - 'headers': dict(response.headers), + 'headers': {str(key): value for key, value in response.headers.items()}, 'body': {'string': (await response.read())}, # NOQA: E999 - 'url': response.url, + 'url': str(response.url), } cassette.append(vcr_request, vcr_response)