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
Provenance
- Commit
f5c27ec- Tree
8ad2fc5- Author
Florimond Manca <florimond.manca@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
28c7205
7 files changed+23 added−23 removed
modified:httpx/_api.py+1 added-1 removed
82 unmodified lines83 <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 linesmodified:httpx/_client.py+6 added-6 removed
88 unmodified lines89 return url90 return url.copy_with(path=url.path + "/")91 92 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 lines670 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 )676 677 def send(678 self,21 unmodified lines700 701 auth = self._build_request_auth(request, auth)702 703 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 )706 707 if not stream:708 try:569 unmodified lines1278 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 response1285 1286 async def send(22 unmodified lines1309 1310 auth = self._build_request_auth(request, auth)1311 1312 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 )1315 1316 if not stream:1317 try:73 unmodified lines1391 request = next_request1392 history.append(response)1393 1394 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 linesmodified:httpx/_config.py+1 added-1 removed
372 unmodified lines373 374 375 class 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 linesmodified:tests/client/test_auth.py+1 added-1 removed
102 unmodified lines103 body = JSONStream({"auth": authorization})104 return b"HTTP/1.1", 200, b"", [], body105 106 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 += 1532 unmodified linesmodified:tests/models/test_responses.py+1 added-1 removed
103 unmodified lines104 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 linesmodified:tests/test_utils.py+12 added-12 removed
235 unmodified lines236 237 @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 )254 def test_url_matches(pattern, url, expected):255 pattern = URLPattern(pattern)17 unmodified linesmodified:requirements.txt+1 added-1 removed
12 unmodified lines13 wheel14 15 # Tests & Linting16 autoflake17-black17+black==20.8b118 cryptography19 flake820 flake8-bugbear21 flake8-pie13 unmodified lines