@@ -147,13 +147,6 @@ def test_request_info_with_fragment(make_client_request: _RequestMaker) -> None:
147
147
)
148
148
149
149
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
-
157
150
def test_host_port_default_http (make_client_request : _RequestMaker ) -> None :
158
151
req = make_client_request ("get" , URL ("http://python.org/" ))
159
152
assert req .url .host == "python.org"
@@ -1222,7 +1215,6 @@ async def test_body_payload_with_size_no_content_length(
1222
1215
1223
1216
# Verify Content-Length is back to 0 for POST with None body
1224
1217
assert req .headers [hdrs .CONTENT_LENGTH ] == "0"
1225
- assert req ._body is None
1226
1218
1227
1219
await req ._close ()
1228
1220
@@ -1965,7 +1957,7 @@ async def test_warn_if_unclosed_payload_via_body_setter(
1965
1957
io .BufferedReader (io .BytesIO (b"test data" )),
1966
1958
encoding = "utf-8" ,
1967
1959
)
1968
- req .update_body (file_payload )
1960
+ await req .update_body (file_payload )
1969
1961
1970
1962
# Setting body again should trigger the warning for the previous payload
1971
1963
with pytest .warns (
@@ -1985,7 +1977,7 @@ async def test_no_warn_for_autoclose_payload_via_body_setter(
1985
1977
1986
1978
# First set BytesIOPayload which has autoclose=True
1987
1979
bytes_payload = payload .BytesIOPayload (io .BytesIO (b"test data" ))
1988
- req .update_body (bytes_payload )
1980
+ await req .update_body (bytes_payload )
1989
1981
1990
1982
# Setting body again should not trigger warning since previous payload has autoclose=True
1991
1983
with warnings .catch_warnings (record = True ) as warning_list :
@@ -2012,7 +2004,7 @@ async def test_no_warn_for_consumed_payload_via_body_setter(
2012
2004
io .BufferedReader (io .BytesIO (b"test data" )),
2013
2005
encoding = "utf-8" ,
2014
2006
)
2015
- req .update_body (file_payload )
2007
+ await req .update_body (file_payload )
2016
2008
2017
2009
# Properly close the payload to mark it as consumed
2018
2010
await file_payload .close ()
@@ -2262,7 +2254,7 @@ async def test_warn_stacklevel_points_to_user_code(
2262
2254
io .BufferedReader (io .BytesIO (b"test data" )),
2263
2255
encoding = "utf-8" ,
2264
2256
)
2265
- req .update_body (file_payload )
2257
+ await req .update_body (file_payload )
2266
2258
2267
2259
# Capture warnings with their details
2268
2260
with warnings .catch_warnings (record = True ) as warning_list :
0 commit comments