Skip to content

Commit 8bf5d4d

Browse files
[pre-commit.ci] pre-commit autoupdate (#10376)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f46ccff commit 8bf5d4d

File tree

5 files changed

+35
-35
lines changed

5 files changed

+35
-35
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ repos:
5656
hooks:
5757
- id: yesqa
5858
- repo: https://github.com/PyCQA/isort
59-
rev: '5.13.2'
59+
rev: '6.0.0'
6060
hooks:
6161
- id: isort
6262
- repo: https://github.com/psf/black
63-
rev: '24.10.0'
63+
rev: '25.1.0'
6464
hooks:
6565
- id: black
6666
language_version: python3 # Should be a command that runs python
@@ -119,7 +119,7 @@ repos:
119119
exclude: >-
120120
^CHANGES\.rst$
121121
- repo: https://github.com/codespell-project/codespell
122-
rev: v2.4.0
122+
rev: v2.4.1
123123
hooks:
124124
- id: codespell
125125
additional_dependencies:

tests/test_client_session.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,21 @@ def params() -> _Params:
9898

9999

100100
async def test_close_coro(
101-
create_session: Callable[..., Awaitable[ClientSession]]
101+
create_session: Callable[..., Awaitable[ClientSession]],
102102
) -> None:
103103
session = await create_session()
104104
await session.close()
105105

106106

107107
async def test_init_headers_simple_dict(
108-
create_session: Callable[..., Awaitable[ClientSession]]
108+
create_session: Callable[..., Awaitable[ClientSession]],
109109
) -> None:
110110
session = await create_session(headers={"h1": "header1", "h2": "header2"})
111111
assert sorted(session.headers.items()) == ([("h1", "header1"), ("h2", "header2")])
112112

113113

114114
async def test_init_headers_list_of_tuples(
115-
create_session: Callable[..., Awaitable[ClientSession]]
115+
create_session: Callable[..., Awaitable[ClientSession]],
116116
) -> None:
117117
session = await create_session(
118118
headers=[("h1", "header1"), ("h2", "header2"), ("h3", "header3")]
@@ -123,7 +123,7 @@ async def test_init_headers_list_of_tuples(
123123

124124

125125
async def test_init_headers_MultiDict(
126-
create_session: Callable[..., Awaitable[ClientSession]]
126+
create_session: Callable[..., Awaitable[ClientSession]],
127127
) -> None:
128128
session = await create_session(
129129
headers=MultiDict([("h1", "header1"), ("h2", "header2"), ("h3", "header3")])
@@ -134,7 +134,7 @@ async def test_init_headers_MultiDict(
134134

135135

136136
async def test_init_headers_list_of_tuples_with_duplicates(
137-
create_session: Callable[..., Awaitable[ClientSession]]
137+
create_session: Callable[..., Awaitable[ClientSession]],
138138
) -> None:
139139
session = await create_session(
140140
headers=[("h1", "header11"), ("h2", "header21"), ("h1", "header12")]
@@ -145,7 +145,7 @@ async def test_init_headers_list_of_tuples_with_duplicates(
145145

146146

147147
async def test_init_cookies_with_simple_dict(
148-
create_session: Callable[..., Awaitable[ClientSession]]
148+
create_session: Callable[..., Awaitable[ClientSession]],
149149
) -> None:
150150
session = await create_session(cookies={"c1": "cookie1", "c2": "cookie2"})
151151
cookies = session.cookie_jar.filter_cookies(URL())
@@ -155,7 +155,7 @@ async def test_init_cookies_with_simple_dict(
155155

156156

157157
async def test_init_cookies_with_list_of_tuples(
158-
create_session: Callable[..., Awaitable[ClientSession]]
158+
create_session: Callable[..., Awaitable[ClientSession]],
159159
) -> None:
160160
session = await create_session(cookies=[("c1", "cookie1"), ("c2", "cookie2")])
161161

@@ -166,7 +166,7 @@ async def test_init_cookies_with_list_of_tuples(
166166

167167

168168
async def test_merge_headers(
169-
create_session: Callable[..., Awaitable[ClientSession]]
169+
create_session: Callable[..., Awaitable[ClientSession]],
170170
) -> None:
171171
# Check incoming simple dict
172172
session = await create_session(headers={"h1": "header1", "h2": "header2"})
@@ -177,7 +177,7 @@ async def test_merge_headers(
177177

178178

179179
async def test_merge_headers_with_multi_dict(
180-
create_session: Callable[..., Awaitable[ClientSession]]
180+
create_session: Callable[..., Awaitable[ClientSession]],
181181
) -> None:
182182
session = await create_session(headers={"h1": "header1", "h2": "header2"})
183183
headers = session._prepare_headers(MultiDict([("h1", "h1")]))
@@ -186,7 +186,7 @@ async def test_merge_headers_with_multi_dict(
186186

187187

188188
async def test_merge_headers_with_list_of_tuples(
189-
create_session: Callable[..., Awaitable[ClientSession]]
189+
create_session: Callable[..., Awaitable[ClientSession]],
190190
) -> None:
191191
session = await create_session(headers={"h1": "header1", "h2": "header2"})
192192
headers = session._prepare_headers([("h1", "h1")])
@@ -1049,7 +1049,7 @@ async def test_client_session_timeout_default_args(
10491049

10501050

10511051
async def test_client_session_timeout_zero(
1052-
create_mocked_conn: Callable[[], ResponseHandler]
1052+
create_mocked_conn: Callable[[], ResponseHandler],
10531053
) -> None:
10541054
async def create_connection(
10551055
req: object, traces: object, timeout: object

tests/test_cookiejar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ def test_pickle_format(cookies_to_send: SimpleCookie) -> None:
11291129
],
11301130
)
11311131
async def test_treat_as_secure_origin_init(
1132-
url: Union[str, URL, List[str], List[URL]]
1132+
url: Union[str, URL, List[str], List[URL]],
11331133
) -> None:
11341134
jar = CookieJar(unsafe=True, treat_as_secure_origin=url)
11351135
assert jar._treat_as_secure_origin == frozenset({URL("http://127.0.0.1")})

tests/test_http_parser.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ def test_bad_header_name(
214214
(
215215
"Content-Length: -5", # https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length
216216
"Content-Length: +256",
217-
"Content-Length: \N{superscript one}",
218-
"Content-Length: \N{mathematical double-struck digit one}",
217+
"Content-Length: \N{SUPERSCRIPT ONE}",
218+
"Content-Length: \N{MATHEMATICAL DOUBLE-STRUCK DIGIT ONE}",
219219
"Foo: abc\rdef", # https://www.rfc-editor.org/rfc/rfc9110.html#section-5.5-5
220220
"Bar: abc\ndef",
221221
"Baz: abc\x00def",
@@ -820,11 +820,11 @@ def test_http_request_bad_status_line(parser: HttpRequestParser) -> None:
820820
_num: Dict[bytes, str] = {
821821
# dangerous: accepted by Python int()
822822
# unicodedata.category("\U0001D7D9") == 'Nd'
823-
"\N{mathematical double-struck digit one}".encode(): "utf8digit",
823+
"\N{MATHEMATICAL DOUBLE-STRUCK DIGIT ONE}".encode(): "utf8digit",
824824
# only added for interop tests, refused by Python int()
825825
# unicodedata.category("\U000000B9") == 'No'
826-
"\N{superscript one}".encode(): "utf8number",
827-
"\N{superscript one}".encode("latin-1"): "latin1number",
826+
"\N{SUPERSCRIPT ONE}".encode(): "utf8number",
827+
"\N{SUPERSCRIPT ONE}".encode("latin-1"): "latin1number",
828828
}
829829

830830

@@ -839,7 +839,7 @@ def test_http_request_bad_status_line_number(
839839

840840
def test_http_request_bad_status_line_separator(parser: HttpRequestParser) -> None:
841841
# single code point, old, multibyte NFKC, multibyte NFKD
842-
utf8sep = "\N{arabic ligature sallallahou alayhe wasallam}".encode()
842+
utf8sep = "\N{ARABIC LIGATURE SALLALLAHOU ALAYHE WASALLAM}".encode()
843843
text = b"GET /ligature HTTP/1" + utf8sep + b"1\r\n\r\n"
844844
with pytest.raises(http_exceptions.BadStatusLine):
845845
parser.feed_data(text)
@@ -913,7 +913,7 @@ def test_http_request_parser_utf8_request_line(parser: HttpRequestParser) -> Non
913913
b"GET /P\xc3\xbcnktchen\xa0\xef\xb7 HTTP/1.1\r\n" +
914914
# for easier grep: ASCII 0xA0 more commonly known as non-breaking space
915915
# note the leading and trailing spaces
916-
"sTeP: \N{latin small letter sharp s}nek\t\N{no-break space} "
916+
"sTeP: \N{LATIN SMALL LETTER SHARP S}nek\t\N{NO-BREAK SPACE} "
917917
"\r\n\r\n".encode()
918918
)
919919
msg = messages[0][0]
@@ -1673,7 +1673,7 @@ async def test_parse_eof_payload(self, protocol: BaseProtocol) -> None:
16731673
p.feed_eof()
16741674

16751675
assert out.is_eof()
1676-
assert [(bytearray(b"data"))] == list(out._buffer)
1676+
assert [bytearray(b"data")] == list(out._buffer)
16771677

16781678
async def test_parse_length_payload_eof(self, protocol: BaseProtocol) -> None:
16791679
out = aiohttp.StreamReader(protocol, 2**16, loop=asyncio.get_running_loop())

tests/test_proxy_functional.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ async def proxy_server() -> mock.Mock:
292292

293293

294294
async def test_proxy_http_absolute_path(
295-
proxy_test_server: Callable[[], Awaitable[mock.Mock]]
295+
proxy_test_server: Callable[[], Awaitable[mock.Mock]],
296296
) -> None:
297297
url = "http://aiohttp.io/path?query=yes"
298298
proxy = await proxy_test_server()
@@ -306,7 +306,7 @@ async def test_proxy_http_absolute_path(
306306

307307

308308
async def test_proxy_http_raw_path(
309-
proxy_test_server: Callable[[], Awaitable[mock.Mock]]
309+
proxy_test_server: Callable[[], Awaitable[mock.Mock]],
310310
) -> None:
311311
url = "http://aiohttp.io:2561/space sheep?q=can:fly"
312312
raw_url = "/space%20sheep?q=can:fly"
@@ -319,7 +319,7 @@ async def test_proxy_http_raw_path(
319319

320320

321321
async def test_proxy_http_idna_support(
322-
proxy_test_server: Callable[[], Awaitable[mock.Mock]]
322+
proxy_test_server: Callable[[], Awaitable[mock.Mock]],
323323
) -> None:
324324
url = "http://éé.com/"
325325
proxy = await proxy_test_server()
@@ -339,7 +339,7 @@ async def test_proxy_http_connection_error() -> None:
339339

340340

341341
async def test_proxy_http_bad_response(
342-
proxy_test_server: Callable[[], Awaitable[mock.Mock]]
342+
proxy_test_server: Callable[[], Awaitable[mock.Mock]],
343343
) -> None:
344344
url = "http://aiohttp.io/path"
345345
proxy = await proxy_test_server()
@@ -352,7 +352,7 @@ async def test_proxy_http_bad_response(
352352

353353

354354
async def test_proxy_http_auth(
355-
proxy_test_server: Callable[[], Awaitable[mock.Mock]]
355+
proxy_test_server: Callable[[], Awaitable[mock.Mock]],
356356
) -> None:
357357
url = "http://aiohttp.io/path"
358358
proxy = await proxy_test_server()
@@ -380,7 +380,7 @@ async def test_proxy_http_auth(
380380

381381

382382
async def test_proxy_http_auth_utf8(
383-
proxy_test_server: Callable[[], Awaitable[mock.Mock]]
383+
proxy_test_server: Callable[[], Awaitable[mock.Mock]],
384384
) -> None:
385385
url = "http://aiohttp.io/path"
386386
auth = aiohttp.BasicAuth("юзер", "пасс", "utf-8")
@@ -393,7 +393,7 @@ async def test_proxy_http_auth_utf8(
393393

394394

395395
async def test_proxy_http_auth_from_url(
396-
proxy_test_server: Callable[[], Awaitable[mock.Mock]]
396+
proxy_test_server: Callable[[], Awaitable[mock.Mock]],
397397
) -> None:
398398
url = "http://aiohttp.io/path"
399399
proxy = await proxy_test_server()
@@ -492,7 +492,7 @@ async def request(pid: int) -> ClientResponse:
492492

493493
@pytest.mark.xfail
494494
async def test_proxy_https_connect(
495-
proxy_test_server: Callable[[], Awaitable[mock.Mock]]
495+
proxy_test_server: Callable[[], Awaitable[mock.Mock]],
496496
) -> None:
497497
proxy = await proxy_test_server()
498498
url = "https://www.google.com.ua/search?q=aiohttp proxy"
@@ -510,7 +510,7 @@ async def test_proxy_https_connect(
510510

511511
@pytest.mark.xfail
512512
async def test_proxy_https_connect_with_port(
513-
proxy_test_server: Callable[[], Awaitable[mock.Mock]]
513+
proxy_test_server: Callable[[], Awaitable[mock.Mock]],
514514
) -> None:
515515
proxy = await proxy_test_server()
516516
url = "https://secure.aiohttp.io:2242/path"
@@ -545,7 +545,7 @@ async def test_proxy_https_send_body(
545545

546546
@pytest.mark.xfail
547547
async def test_proxy_https_idna_support(
548-
proxy_test_server: Callable[[], Awaitable[mock.Mock]]
548+
proxy_test_server: Callable[[], Awaitable[mock.Mock]],
549549
) -> None:
550550
url = "https://éé.com/"
551551
proxy = await proxy_test_server()
@@ -567,7 +567,7 @@ async def test_proxy_https_connection_error() -> None:
567567

568568

569569
async def test_proxy_https_bad_response(
570-
proxy_test_server: Callable[[], Awaitable[mock.Mock]]
570+
proxy_test_server: Callable[[], Awaitable[mock.Mock]],
571571
) -> None:
572572
url = "https://secure.aiohttp.io/path"
573573
proxy = await proxy_test_server()
@@ -584,7 +584,7 @@ async def test_proxy_https_bad_response(
584584

585585
@pytest.mark.xfail
586586
async def test_proxy_https_auth(
587-
proxy_test_server: Callable[[], Awaitable[mock.Mock]]
587+
proxy_test_server: Callable[[], Awaitable[mock.Mock]],
588588
) -> None:
589589
url = "https://secure.aiohttp.io/path"
590590
auth = aiohttp.BasicAuth("user", "pass")

0 commit comments

Comments
 (0)