Skip to content

Commit f4ebcb7

Browse files
committed
Fixes
1 parent 500a4fb commit f4ebcb7

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

tests/test_client_request.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,6 @@ def test_request_info_with_fragment(make_client_request: _RequestMaker) -> None:
147147
)
148148

149149

150-
def test_version_err(make_client_request: _RequestMaker) -> None:
151-
with pytest.raises(ValueError):
152-
make_client_request(
153-
"get", URL("http://python.org/"), version=HttpVersion("1.c")
154-
)
155-
156-
157150
def test_host_port_default_http(make_client_request: _RequestMaker) -> None:
158151
req = make_client_request("get", URL("http://python.org/"))
159152
assert req.url.host == "python.org"
@@ -1222,7 +1215,6 @@ async def test_body_payload_with_size_no_content_length(
12221215

12231216
# Verify Content-Length is back to 0 for POST with None body
12241217
assert req.headers[hdrs.CONTENT_LENGTH] == "0"
1225-
assert req._body is None
12261218

12271219
await req._close()
12281220

@@ -1965,7 +1957,7 @@ async def test_warn_if_unclosed_payload_via_body_setter(
19651957
io.BufferedReader(io.BytesIO(b"test data")),
19661958
encoding="utf-8",
19671959
)
1968-
req.update_body(file_payload)
1960+
await req.update_body(file_payload)
19691961

19701962
# Setting body again should trigger the warning for the previous payload
19711963
with pytest.warns(
@@ -1985,7 +1977,7 @@ async def test_no_warn_for_autoclose_payload_via_body_setter(
19851977

19861978
# First set BytesIOPayload which has autoclose=True
19871979
bytes_payload = payload.BytesIOPayload(io.BytesIO(b"test data"))
1988-
req.update_body(bytes_payload)
1980+
await req.update_body(bytes_payload)
19891981

19901982
# Setting body again should not trigger warning since previous payload has autoclose=True
19911983
with warnings.catch_warnings(record=True) as warning_list:
@@ -2012,7 +2004,7 @@ async def test_no_warn_for_consumed_payload_via_body_setter(
20122004
io.BufferedReader(io.BytesIO(b"test data")),
20132005
encoding="utf-8",
20142006
)
2015-
req.update_body(file_payload)
2007+
await req.update_body(file_payload)
20162008

20172009
# Properly close the payload to mark it as consumed
20182010
await file_payload.close()
@@ -2262,7 +2254,7 @@ async def test_warn_stacklevel_points_to_user_code(
22622254
io.BufferedReader(io.BytesIO(b"test data")),
22632255
encoding="utf-8",
22642256
)
2265-
req.update_body(file_payload)
2257+
await req.update_body(file_payload)
22662258

22672259
# Capture warnings with their details
22682260
with warnings.catch_warnings(record=True) as warning_list:

0 commit comments

Comments
 (0)