Skip to content
Myr

Use and pin black 20 (#1229)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Florimond Manca · committed by GitHub · parent 28c7205 · Browse files · 7 files+23 added−23 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

7 files+23 added−23 removed

  • tests:+14 added−14 removed
  • other:+9 added−9 removed

7 files+23 added−23 removed

modified:httpx/_api.py+1 added-1 removed
82 unmodified lines
83 <Response [200 OK]>84 ```85 """86 with Client(87 proxies=proxies, cert=cert, verify=verify, timeout=timeout, trust_env=trust_env,87 proxies=proxies, cert=cert, verify=verify, timeout=timeout, trust_env=trust_env88 ) as client:89 return client.request(90 method=method,91 url=url,
333 unmodified lines
modified:httpx/_client.py+6 added-6 removed
88 unmodified lines
89 return url90 return url.copy_with(path=url.path + "/")9192 def _get_proxy_map(93 self, proxies: typing.Optional[ProxiesTypes], allow_env_proxies: bool,93 self, proxies: typing.Optional[ProxiesTypes], allow_env_proxies: bool94 ) -> typing.Dict[str, typing.Optional[Proxy]]:95 if proxies is None:96 if allow_env_proxies:97 return {
572 unmodified lines
670 headers=headers,671 cookies=cookies,672 )673 return self.send(674 request, auth=auth, allow_redirects=allow_redirects, timeout=timeout,674 request, auth=auth, allow_redirects=allow_redirects, timeout=timeout675 )676677 def send(678 self,
21 unmodified lines
700701 auth = self._build_request_auth(request, auth)702703 response = self._send_handling_redirects(704 request, auth=auth, timeout=timeout, allow_redirects=allow_redirects,704 request, auth=auth, timeout=timeout, allow_redirects=allow_redirects705 )706707 if not stream:708 try:
569 unmodified lines
1278 headers=headers,1279 cookies=cookies,1280 )1281 response = await self.send(1282 request, auth=auth, allow_redirects=allow_redirects, timeout=timeout,1282 request, auth=auth, allow_redirects=allow_redirects, timeout=timeout1283 )1284 return response12851286 async def send(
22 unmodified lines
13091310 auth = self._build_request_auth(request, auth)13111312 response = await self._send_handling_redirects(1313 request, auth=auth, timeout=timeout, allow_redirects=allow_redirects,1313 request, auth=auth, timeout=timeout, allow_redirects=allow_redirects1314 )13151316 if not stream:1317 try:
73 unmodified lines
1391 request = next_request1392 history.append(response)13931394 async def _send_single_request(1395 self, request: Request, timeout: Timeout,1395 self, request: Request, timeout: Timeout1396 ) -> Response:1397 """1398 Sends a single request, without handling any redirections.1399 """
326 unmodified lines
modified:httpx/_config.py+1 added-1 removed
372 unmodified lines
373374375class Proxy:376 def __init__(377 self, url: URLTypes, *, headers: HeaderTypes = None, mode: str = "DEFAULT",377 self, url: URLTypes, *, headers: HeaderTypes = None, mode: str = "DEFAULT"378 ):379 url = URL(url)380 headers = Headers(headers)381
34 unmodified lines
modified:tests/client/test_auth.py+1 added-1 removed
102 unmodified lines
103 body = JSONStream({"auth": authorization})104 return b"HTTP/1.1", 200, b"", [], body105106 def challenge_send(107 self, method: bytes, headers: typing.List[typing.Tuple[bytes, bytes]],107 self, method: bytes, headers: typing.List[typing.Tuple[bytes, bytes]]108 ) -> typing.Tuple[109 bytes, int, bytes, typing.List[typing.Tuple[bytes, bytes]], ContentStream110 ]:111 self._response_count += 1
532 unmodified lines
modified:tests/models/test_responses.py+1 added-1 removed
103 unmodified lines
104 headers = {105 "Content-Type": "text-plain; charset=utf-8"106 } # Deliberately incorrect charset107 response = httpx.Response(108 200, content="Latin 1: ÿ".encode("latin-1"), headers=headers, request=REQUEST,108 200, content="Latin 1: ÿ".encode("latin-1"), headers=headers, request=REQUEST109 )110 response.encoding = "latin-1"111 assert response.text == "Latin 1: ÿ"112 assert response.encoding == "latin-1"
285 unmodified lines
modified:tests/test_utils.py+12 added-12 removed
235 unmodified lines
236237@pytest.mark.parametrize(238 ["pattern", "url", "expected"],239 [240 ("http://example.com", "http://example.com", True,),241 ("http://example.com", "https://example.com", False,),242 ("http://example.com", "http://other.com", False,),243 ("http://example.com:123", "http://example.com:123", True,),244 ("http://example.com:123", "http://example.com:456", False,),245 ("http://example.com:123", "http://example.com", False,),246 ("all://example.com", "http://example.com", True,),247 ("all://example.com", "https://example.com", True,),248 ("http://", "http://example.com", True,),249 ("http://", "https://example.com", False,),250 ("all://", "https://example.com:123", True,),251 ("", "https://example.com:123", True,),240 ("http://example.com", "http://example.com", True),241 ("http://example.com", "https://example.com", False),242 ("http://example.com", "http://other.com", False),243 ("http://example.com:123", "http://example.com:123", True),244 ("http://example.com:123", "http://example.com:456", False),245 ("http://example.com:123", "http://example.com", False),246 ("all://example.com", "http://example.com", True),247 ("all://example.com", "https://example.com", True),248 ("http://", "http://example.com", True),249 ("http://", "https://example.com", False),250 ("all://", "https://example.com:123", True),251 ("", "https://example.com:123", True),252 ],253)254def test_url_matches(pattern, url, expected):255 pattern = URLPattern(pattern)
17 unmodified lines
modified:requirements.txt+1 added-1 removed
12 unmodified lines
13wheel1415# Tests & Linting16autoflake17black17black==20.8b118cryptography19flake820flake8-bugbear21flake8-pie
13 unmodified lines