Skip to content

Commit f271c9c

Browse files
committed
Apply latest Black formatting
1 parent 1884878 commit f271c9c

17 files changed

+56
-56
lines changed

dummyserver/handlers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,27 @@ class TestingApp(RequestHandler):
6262
"""
6363

6464
def get(self):
65-
""" Handle GET requests """
65+
"""Handle GET requests"""
6666
self._call_method()
6767

6868
def post(self):
69-
""" Handle POST requests """
69+
"""Handle POST requests"""
7070
self._call_method()
7171

7272
def put(self):
73-
""" Handle PUT requests """
73+
"""Handle PUT requests"""
7474
self._call_method()
7575

7676
def options(self):
77-
""" Handle OPTIONS requests """
77+
"""Handle OPTIONS requests"""
7878
self._call_method()
7979

8080
def head(self):
81-
""" Handle HEAD requests """
81+
"""Handle HEAD requests"""
8282
self._call_method()
8383

8484
def _call_method(self):
85-
""" Call the correct method in this class based on the incoming URI """
85+
"""Call the correct method in this class based on the incoming URI"""
8686
req = self.request
8787
req.params = {}
8888
for k, v in req.arguments.items():

dummyserver/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141

4242
def _resolves_to_ipv6(host):
43-
""" Returns True if the system resolves host to an IPv6 address by default. """
43+
"""Returns True if the system resolves host to an IPv6 address by default."""
4444
resolves_to_ipv6 = False
4545
try:
4646
for res in socket.getaddrinfo(host, None, socket.AF_UNSPEC):
@@ -54,7 +54,7 @@ def _resolves_to_ipv6(host):
5454

5555

5656
def _has_ipv6(host):
57-
""" Returns True if the system can bind an IPv6 address. """
57+
"""Returns True if the system can bind an IPv6 address."""
5858
sock = None
5959
has_ipv6 = False
6060

src/urllib3/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def connect(self):
201201
self._prepare_conn(conn)
202202

203203
def putrequest(self, method, url, *args, **kwargs):
204-
""""""
204+
""" """
205205
# Empty docstring because the indentation of CPython's implementation
206206
# is broken but we don't want this method in our documentation.
207207
match = _CONTAINS_CONTROL_CHAR_RE.search(method)
@@ -214,7 +214,7 @@ def putrequest(self, method, url, *args, **kwargs):
214214
return _HTTPConnection.putrequest(self, method, url, *args, **kwargs)
215215

216216
def putheader(self, header, *values):
217-
""""""
217+
""" """
218218
if not any(isinstance(v, str) and v == SKIP_HEADER for v in values):
219219
_HTTPConnection.putheader(self, header, *values)
220220
elif six.ensure_str(header.lower()) not in SKIPPABLE_HEADERS:

src/urllib3/connectionpool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def _prepare_proxy(self, conn):
318318
pass
319319

320320
def _get_timeout(self, timeout):
321-
""" Helper that always returns a :class:`urllib3.util.Timeout` """
321+
"""Helper that always returns a :class:`urllib3.util.Timeout`"""
322322
if timeout is _Default:
323323
return self.timeout.clone()
324324

src/urllib3/util/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def allowed_gai_family():
118118

119119

120120
def _has_ipv6(host):
121-
""" Returns True if the system can bind an IPv6 address. """
121+
"""Returns True if the system can bind an IPv6 address."""
122122
sock = None
123123
has_ipv6 = False
124124

src/urllib3/util/retry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def new(self, **kw):
321321

322322
@classmethod
323323
def from_int(cls, retries, redirect=True, default=None):
324-
""" Backwards-compatibility for the old retries format."""
324+
"""Backwards-compatibility for the old retries format."""
325325
if retries is None:
326326
retries = default if default is not None else cls.DEFAULT
327327

@@ -374,7 +374,7 @@ def parse_retry_after(self, retry_after):
374374
return seconds
375375

376376
def get_retry_after(self, response):
377-
""" Get the value of Retry-After in seconds. """
377+
"""Get the value of Retry-After in seconds."""
378378

379379
retry_after = response.getheader("Retry-After")
380380

@@ -468,7 +468,7 @@ def is_retry(self, method, status_code, has_retry_after=False):
468468
)
469469

470470
def is_exhausted(self):
471-
""" Are we out of retries? """
471+
"""Are we out of retries?"""
472472
retry_counts = (
473473
self.total,
474474
self.connect,

src/urllib3/util/ssltransport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def _wrap_ssl_read(self, len, buffer=None):
193193
raise
194194

195195
def _ssl_io_loop(self, func, *args):
196-
""" Performs an I/O loop between incoming/outgoing and the socket."""
196+
"""Performs an I/O loop between incoming/outgoing and the socket."""
197197
should_loop = True
198198
ret = None
199199

test/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555

5656
def _can_resolve(host):
57-
""" Returns True if the system can resolve host to an address. """
57+
"""Returns True if the system can resolve host to an address."""
5858
try:
5959
socket.getaddrinfo(host, None, socket.AF_UNSPEC)
6060
return True
@@ -63,7 +63,7 @@ def _can_resolve(host):
6363

6464

6565
def has_alpn(ctx_cls=None):
66-
""" Detect if ALPN support is enabled. """
66+
"""Detect if ALPN support is enabled."""
6767
ctx_cls = ctx_cls or util.SSLContext
6868
ctx = ctx_cls(protocol=ssl_.PROTOCOL_TLS)
6969
try:

test/appengine/test_gae_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def setup_method(self, method):
129129
self.pool = MockPool(self.host, self.port, self.manager)
130130

131131
def test_default_method_whitelist_retried(self):
132-
""" urllib3 should retry methods in the default method whitelist """
132+
"""urllib3 should retry methods in the default method whitelist"""
133133
retry = urllib3.util.retry.Retry(total=1, status_forcelist=[418])
134134
# Use HEAD instead of OPTIONS, as URLFetch doesn't support OPTIONS
135135
resp = self.pool.request(

test/test_retry.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def no_retry_deprecations():
2626

2727
class TestRetry(object):
2828
def test_string(self):
29-
""" Retry string representation looks the way we expect """
29+
"""Retry string representation looks the way we expect"""
3030
retry = Retry()
3131
assert (
3232
str(retry)
@@ -50,7 +50,7 @@ def test_retry_both_specified(self):
5050
assert e.value.reason == error
5151

5252
def test_retry_higher_total_loses(self):
53-
""" A lower connect timeout than the total is honored """
53+
"""A lower connect timeout than the total is honored"""
5454
error = ConnectTimeoutError()
5555
retry = Retry(connect=2, total=3)
5656
retry = retry.increment(error=error)
@@ -59,7 +59,7 @@ def test_retry_higher_total_loses(self):
5959
retry.increment(error=error)
6060

6161
def test_retry_higher_total_loses_vs_read(self):
62-
""" A lower read timeout than the total is honored """
62+
"""A lower read timeout than the total is honored"""
6363
error = ReadTimeoutError(None, "/", "read timed out")
6464
retry = Retry(read=2, total=3)
6565
retry = retry.increment(method="GET", error=error)
@@ -68,7 +68,7 @@ def test_retry_higher_total_loses_vs_read(self):
6868
retry.increment(method="GET", error=error)
6969

7070
def test_retry_total_none(self):
71-
""" if Total is none, connect error should take precedence """
71+
"""if Total is none, connect error should take precedence"""
7272
error = ConnectTimeoutError()
7373
retry = Retry(connect=2, total=None)
7474
retry = retry.increment(error=error)
@@ -85,7 +85,7 @@ def test_retry_total_none(self):
8585
assert not retry.is_exhausted()
8686

8787
def test_retry_default(self):
88-
""" If no value is specified, should retry connects 3 times """
88+
"""If no value is specified, should retry connects 3 times"""
8989
retry = Retry()
9090
assert retry.total == 10
9191
assert retry.connect is None
@@ -107,7 +107,7 @@ def test_retry_default(self):
107107
assert not Retry(False).raise_on_redirect
108108

109109
def test_retry_other(self):
110-
""" If an unexpected error is raised, should retry other times """
110+
"""If an unexpected error is raised, should retry other times"""
111111
other_error = SSLError()
112112
retry = Retry(connect=1)
113113
retry = retry.increment(error=other_error)
@@ -121,7 +121,7 @@ def test_retry_other(self):
121121
assert e.value.reason == other_error
122122

123123
def test_retry_read_zero(self):
124-
""" No second chances on read timeouts, by default """
124+
"""No second chances on read timeouts, by default"""
125125
error = ReadTimeoutError(None, "/", "read timed out")
126126
retry = Retry(read=0)
127127
with pytest.raises(MaxRetryError) as e:
@@ -140,7 +140,7 @@ def test_status_counter(self):
140140
)
141141

142142
def test_backoff(self):
143-
""" Backoff is computed correctly """
143+
"""Backoff is computed correctly"""
144144
max_backoff = Retry.BACKOFF_MAX
145145

146146
retry = Retry(total=100, backoff_factor=0.2)

0 commit comments

Comments
 (0)