]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Use and pin black 20 (#1229)
authorFlorimond Manca <florimond.manca@gmail.com>
Thu, 27 Aug 2020 13:57:53 +0000 (15:57 +0200)
committerGitHub <noreply@github.com>
Thu, 27 Aug 2020 13:57:53 +0000 (14:57 +0100)
httpx/_api.py
httpx/_client.py
httpx/_config.py
requirements.txt
tests/client/test_auth.py
tests/models/test_responses.py
tests/test_utils.py

index ba7bed398ae1aa98c3e254f2271d63916a27996c..afa9ca5cb8845503a72d2e3888a4d7dce0c76e14 100644 (file)
@@ -84,7 +84,7 @@ def request(
     ```
     """
     with Client(
-        proxies=proxies, cert=cert, verify=verify, timeout=timeout, trust_env=trust_env,
+        proxies=proxies, cert=cert, verify=verify, timeout=timeout, trust_env=trust_env
     ) as client:
         return client.request(
             method=method,
index 0f4110c8f0645052264a398503c3518dbcd63473..8d323f26afde6503737f13ce0fa3cf8d8f2d13d4 100644 (file)
@@ -90,7 +90,7 @@ class BaseClient:
         return url.copy_with(path=url.path + "/")
 
     def _get_proxy_map(
-        self, proxies: typing.Optional[ProxiesTypes], allow_env_proxies: bool,
+        self, proxies: typing.Optional[ProxiesTypes], allow_env_proxies: bool
     ) -> typing.Dict[str, typing.Optional[Proxy]]:
         if proxies is None:
             if allow_env_proxies:
@@ -671,7 +671,7 @@ class Client(BaseClient):
             cookies=cookies,
         )
         return self.send(
-            request, auth=auth, allow_redirects=allow_redirects, timeout=timeout,
+            request, auth=auth, allow_redirects=allow_redirects, timeout=timeout
         )
 
     def send(
@@ -701,7 +701,7 @@ class Client(BaseClient):
         auth = self._build_request_auth(request, auth)
 
         response = self._send_handling_redirects(
-            request, auth=auth, timeout=timeout, allow_redirects=allow_redirects,
+            request, auth=auth, timeout=timeout, allow_redirects=allow_redirects
         )
 
         if not stream:
@@ -1279,7 +1279,7 @@ class AsyncClient(BaseClient):
             cookies=cookies,
         )
         response = await self.send(
-            request, auth=auth, allow_redirects=allow_redirects, timeout=timeout,
+            request, auth=auth, allow_redirects=allow_redirects, timeout=timeout
         )
         return response
 
@@ -1310,7 +1310,7 @@ class AsyncClient(BaseClient):
         auth = self._build_request_auth(request, auth)
 
         response = await self._send_handling_redirects(
-            request, auth=auth, timeout=timeout, allow_redirects=allow_redirects,
+            request, auth=auth, timeout=timeout, allow_redirects=allow_redirects
         )
 
         if not stream:
@@ -1392,7 +1392,7 @@ class AsyncClient(BaseClient):
                 history.append(response)
 
     async def _send_single_request(
-        self, request: Request, timeout: Timeout,
+        self, request: Request, timeout: Timeout
     ) -> Response:
         """
         Sends a single request, without handling any redirections.
index 4284a329f940a4565e018cb352f6e144c12c630f..8d589eadecaebe6235cf64cf37ee4abc791be3a8 100644 (file)
@@ -374,7 +374,7 @@ class PoolLimits(Limits):
 
 class Proxy:
     def __init__(
-        self, url: URLTypes, *, headers: HeaderTypes = None, mode: str = "DEFAULT",
+        self, url: URLTypes, *, headers: HeaderTypes = None, mode: str = "DEFAULT"
     ):
         url = URL(url)
         headers = Headers(headers)
index a901dbeaa8e6bdb3e05252ccf967cbba0481f90b..b871b15cdb6753cb76494b00d30d77541955b5c6 100644 (file)
@@ -14,7 +14,7 @@ wheel
 
 # Tests & Linting
 autoflake
-black
+black==20.8b1
 cryptography
 flake8
 flake8-bugbear
index edfccf0a704de79711b1e9b8fff85d8445babab5..ae35e2cd35d983fc82231898943470bbc2111881 100644 (file)
@@ -104,7 +104,7 @@ class MockDigestAuthTransport(httpcore.AsyncHTTPTransport):
         return b"HTTP/1.1", 200, b"", [], body
 
     def challenge_send(
-        self, method: bytes, headers: typing.List[typing.Tuple[bytes, bytes]],
+        self, method: bytes, headers: typing.List[typing.Tuple[bytes, bytes]]
     ) -> typing.Tuple[
         bytes, int, bytes, typing.List[typing.Tuple[bytes, bytes]], ContentStream
     ]:
index de330fefe78899f7b5fa5be6e1795278856cdeab..878bef072d49da7f1c92bafe94d9a2649c7772d4 100644 (file)
@@ -105,7 +105,7 @@ def test_response_set_explicit_encoding():
         "Content-Type": "text-plain; charset=utf-8"
     }  # Deliberately incorrect charset
     response = httpx.Response(
-        200, content="Latin 1: ÿ".encode("latin-1"), headers=headers, request=REQUEST,
+        200, content="Latin 1: ÿ".encode("latin-1"), headers=headers, request=REQUEST
     )
     response.encoding = "latin-1"
     assert response.text == "Latin 1: ÿ"
index 461e4b962a3bac6627cd8f535b39ddfb6c083d3b..d5dfb5819b6017e6d1b13ac5822aa28460b121b8 100644 (file)
@@ -237,18 +237,18 @@ def test_not_same_origin():
 @pytest.mark.parametrize(
     ["pattern", "url", "expected"],
     [
-        ("http://example.com", "http://example.com", True,),
-        ("http://example.com", "https://example.com", False,),
-        ("http://example.com", "http://other.com", False,),
-        ("http://example.com:123", "http://example.com:123", True,),
-        ("http://example.com:123", "http://example.com:456", False,),
-        ("http://example.com:123", "http://example.com", False,),
-        ("all://example.com", "http://example.com", True,),
-        ("all://example.com", "https://example.com", True,),
-        ("http://", "http://example.com", True,),
-        ("http://", "https://example.com", False,),
-        ("all://", "https://example.com:123", True,),
-        ("", "https://example.com:123", True,),
+        ("http://example.com", "http://example.com", True),
+        ("http://example.com", "https://example.com", False),
+        ("http://example.com", "http://other.com", False),
+        ("http://example.com:123", "http://example.com:123", True),
+        ("http://example.com:123", "http://example.com:456", False),
+        ("http://example.com:123", "http://example.com", False),
+        ("all://example.com", "http://example.com", True),
+        ("all://example.com", "https://example.com", True),
+        ("http://", "http://example.com", True),
+        ("http://", "https://example.com", False),
+        ("all://", "https://example.com:123", True),
+        ("", "https://example.com:123", True),
     ],
 )
 def test_url_matches(pattern, url, expected):