mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
Fix ruff SIM117: use combined with statement
This commit is contained in:
@@ -176,11 +176,11 @@ def test_post(tmpdir, kwargs, caplog, httpbin):
|
|||||||
@pytest.mark.online
|
@pytest.mark.online
|
||||||
def test_post_data_plus_json_error(tmpdir, httpbin):
|
def test_post_data_plus_json_error(tmpdir, httpbin):
|
||||||
url = httpbin.url + "/post"
|
url = httpbin.url + "/post"
|
||||||
with vcr.use_cassette(str(tmpdir.join("post.yaml"))) as cassette:
|
with (
|
||||||
with pytest.raises(
|
vcr.use_cassette(str(tmpdir.join("post.yaml"))) as cassette,
|
||||||
ValueError, match="data and json parameters can not be used at the same time"
|
pytest.raises(ValueError, match="data and json parameters can not be used at the same time"),
|
||||||
):
|
):
|
||||||
post(url, data=POST_DATA, json=POST_DATA)
|
post(url, data=POST_DATA, json=POST_DATA)
|
||||||
assert cassette.requests == []
|
assert cassette.requests == []
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user