From 7add8c0babc88c08825ae03233a0ba6e5dad67d3 Mon Sep 17 00:00:00 2001 From: Andre Ambrosio Boechat Date: Tue, 3 May 2022 13:18:22 -0300 Subject: [PATCH] Don't assume params to be a dictionary aiohttp also fails with pass parameter values with types other than string, integer or float. --- tests/integration/test_aiohttp.py | 4 ++-- vcr/stubs/aiohttp_stubs.py | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/integration/test_aiohttp.py b/tests/integration/test_aiohttp.py index 55f21b7..55f9a89 100644 --- a/tests/integration/test_aiohttp.py +++ b/tests/integration/test_aiohttp.py @@ -154,7 +154,7 @@ def test_post(tmpdir, scheme, body, caplog): def test_params(tmpdir, scheme): url = scheme + "://httpbin.org/get" headers = {"Content-Type": "application/json"} - params = {"a": 1, "b": False, "c": "c"} + params = {"a": 1, "b": 2, "c": "c"} with vcr.use_cassette(str(tmpdir.join("get.yaml"))) as cassette: _, response_json = get(url, output="json", params=params, headers=headers) @@ -168,7 +168,7 @@ def test_params(tmpdir, scheme): def test_params_same_url_distinct_params(tmpdir, scheme): url = scheme + "://httpbin.org/get" headers = {"Content-Type": "application/json"} - params = {"a": 1, "b": False, "c": "c"} + params = {"a": 1, "b": 2, "c": "c"} with vcr.use_cassette(str(tmpdir.join("get.yaml"))) as cassette: _, response_json = get(url, output="json", params=params, headers=headers) diff --git a/vcr/stubs/aiohttp_stubs.py b/vcr/stubs/aiohttp_stubs.py index 959e394..f95ee7c 100644 --- a/vcr/stubs/aiohttp_stubs.py +++ b/vcr/stubs/aiohttp_stubs.py @@ -244,8 +244,6 @@ def vcr_request(cassette, real_request): request_url = URL(url) if params: - for k, v in params.items(): - params[k] = str(v) request_url = URL(url).with_query(params) c_header = headers.pop(hdrs.COOKIE, None)