1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

Fix ruff linting issues in aiohttp tests

This commit is contained in:
Kevin McCarthy
2025-12-08 09:16:46 -05:00
parent 31d8c3498b
commit 48f5f84f86

View File

@@ -144,10 +144,10 @@ POST_DATA = {"key1": "value1", "key2": "value2"}
@pytest.mark.parametrize(
"kwargs",
[
dict(data=POST_DATA),
dict(json=POST_DATA),
dict(data=POST_DATA, json=None),
dict(data=None, json=POST_DATA),
{"data": POST_DATA},
{"json": POST_DATA},
{"data": POST_DATA, "json": None},
{"data": None, "json": POST_DATA},
],
)
def test_post(tmpdir, kwargs, caplog, httpbin):
@@ -176,10 +176,11 @@ def test_post(tmpdir, kwargs, caplog, httpbin):
@pytest.mark.online
def test_post_data_plus_json_error(tmpdir, httpbin):
url = httpbin.url + "/post"
with vcr.use_cassette(str(tmpdir.join("post.yaml"))) as cassette, pytest.raises(
ValueError, match="data and json parameters can not be used at the same time"
):
post(url, data=POST_DATA, json=POST_DATA)
with vcr.use_cassette(str(tmpdir.join("post.yaml"))) as cassette:
with pytest.raises(
ValueError, match="data and json parameters can not be used at the same time"
):
post(url, data=POST_DATA, json=POST_DATA)
assert cassette.requests == []