Skip to content

Commit cf18991

Browse files
update black to 22.3.0
1 parent 883fca7 commit cf18991

File tree

8 files changed

+37
-46
lines changed

8 files changed

+37
-46
lines changed

benchmarks/cluster_async.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ async def main(loop, gather=None):
206206
host=host,
207207
port=port,
208208
password=password,
209-
max_connections=2 ** 31,
210-
max_connections_per_node=2 ** 31,
209+
max_connections=2**31,
210+
max_connections_per_node=2**31,
211211
readonly=False,
212212
reinitialize_steps=count,
213213
skip_full_coverage_check=True,
@@ -224,7 +224,7 @@ async def main(loop, gather=None):
224224
password=password,
225225
state_reload_interval=count,
226226
idle_connection_timeout=count,
227-
pool_maxsize=2 ** 31,
227+
pool_maxsize=2**31,
228228
)
229229
print(f"{loop} {gather} {await warmup(aiorc)} aioredis-cluster")
230230
print(await run(aiorc, gather=gather))
@@ -238,7 +238,7 @@ async def main(loop, gather=None):
238238
reinitialize_steps=count,
239239
read_from_replicas=False,
240240
decode_responses=False,
241-
max_connections=2 ** 31,
241+
max_connections=2**31,
242242
) as rca:
243243
print(f"{loop} {gather} {await warmup(rca)} redispy")
244244
print(await run(rca, gather=gather))

dev_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
click==8.0.4
2-
black==21.11b1
2+
black==22.3.0
33
flake8==4.0.1
44
flynt~=0.69.0
55
isort==5.10.1

redis/asyncio/cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ def __init__(
723723
host: str,
724724
port: int,
725725
server_type: Optional[str] = None,
726-
max_connections: int = 2 ** 31,
726+
max_connections: int = 2**31,
727727
connection_class: Type[Connection] = Connection,
728728
response_callbacks: Dict = None,
729729
**connection_kwargs,

redis/asyncio/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ def __init__(
13901390
max_connections: Optional[int] = None,
13911391
**connection_kwargs,
13921392
):
1393-
max_connections = max_connections or 2 ** 31
1393+
max_connections = max_connections or 2**31
13941394
if not isinstance(max_connections, int) or max_connections < 0:
13951395
raise ValueError('"max_connections" must be a positive integer')
13961396

redis/backoff.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __init__(self, cap, base):
4949
self._base = base
5050

5151
def compute(self, failures):
52-
return min(self._cap, self._base * 2 ** failures)
52+
return min(self._cap, self._base * 2**failures)
5353

5454

5555
class FullJitterBackoff(AbstractBackoff):
@@ -64,7 +64,7 @@ def __init__(self, cap, base):
6464
self._base = base
6565

6666
def compute(self, failures):
67-
return random.uniform(0, min(self._cap, self._base * 2 ** failures))
67+
return random.uniform(0, min(self._cap, self._base * 2**failures))
6868

6969

7070
class EqualJitterBackoff(AbstractBackoff):
@@ -79,7 +79,7 @@ def __init__(self, cap, base):
7979
self._base = base
8080

8181
def compute(self, failures):
82-
temp = min(self._cap, self._base * 2 ** failures) / 2
82+
temp = min(self._cap, self._base * 2**failures) / 2
8383
return temp + random.uniform(0, temp)
8484

8585

redis/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ class initializer. In the case of conflicting arguments, querystring
12881288
def __init__(
12891289
self, connection_class=Connection, max_connections=None, **connection_kwargs
12901290
):
1291-
max_connections = max_connections or 2 ** 31
1291+
max_connections = max_connections or 2**31
12921292
if not isinstance(max_connections, int) or max_connections < 0:
12931293
raise ValueError('"max_connections" must be a positive integer')
12941294

tests/test_asyncio/test_commands.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2534,17 +2534,14 @@ async def test_xclaim(self, r: redis.Redis):
25342534

25352535
# reclaim the message as consumer1, but use the justid argument
25362536
# which only returns message ids
2537-
assert (
2538-
await r.xclaim(
2539-
stream,
2540-
group,
2541-
consumer1,
2542-
min_idle_time=0,
2543-
message_ids=(message_id,),
2544-
justid=True,
2545-
)
2546-
== [message_id]
2547-
)
2537+
assert await r.xclaim(
2538+
stream,
2539+
group,
2540+
consumer1,
2541+
min_idle_time=0,
2542+
message_ids=(message_id,),
2543+
justid=True,
2544+
) == [message_id]
25482545

25492546
@skip_if_server_version_lt("5.0.0")
25502547
async def test_xclaim_trimmed(self, r: redis.Redis):

tests/test_commands.py

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3359,18 +3359,15 @@ def test_geosearch_with(self, r):
33593359
(2.19093829393386841, 41.43379028184083523),
33603360
]
33613361
]
3362-
assert (
3363-
r.geosearch(
3364-
"barcelona",
3365-
longitude=2.191,
3366-
latitude=41.433,
3367-
radius=1,
3368-
unit="km",
3369-
withdist=True,
3370-
withcoord=True,
3371-
)
3372-
== [[b"place1", 0.0881, (2.19093829393386841, 41.43379028184083523)]]
3373-
)
3362+
assert r.geosearch(
3363+
"barcelona",
3364+
longitude=2.191,
3365+
latitude=41.433,
3366+
radius=1,
3367+
unit="km",
3368+
withdist=True,
3369+
withcoord=True,
3370+
) == [[b"place1", 0.0881, (2.19093829393386841, 41.43379028184083523)]]
33743371
assert r.geosearch(
33753372
"barcelona",
33763373
longitude=2.191,
@@ -3700,7 +3697,7 @@ def test_xack(self, r):
37003697
def test_xadd(self, r):
37013698
stream = "stream"
37023699
message_id = r.xadd(stream, {"foo": "bar"})
3703-
assert re.match(br"[0-9]+\-[0-9]+", message_id)
3700+
assert re.match(rb"[0-9]+\-[0-9]+", message_id)
37043701

37053702
# explicit message id
37063703
message_id = b"9999999999999999999-0"
@@ -3846,17 +3843,14 @@ def test_xclaim(self, r):
38463843

38473844
# reclaim the message as consumer1, but use the justid argument
38483845
# which only returns message ids
3849-
assert (
3850-
r.xclaim(
3851-
stream,
3852-
group,
3853-
consumer1,
3854-
min_idle_time=0,
3855-
message_ids=(message_id,),
3856-
justid=True,
3857-
)
3858-
== [message_id]
3859-
)
3846+
assert r.xclaim(
3847+
stream,
3848+
group,
3849+
consumer1,
3850+
min_idle_time=0,
3851+
message_ids=(message_id,),
3852+
justid=True,
3853+
) == [message_id]
38603854

38613855
@skip_if_server_version_lt("7.0.0")
38623856
def test_xclaim_trimmed(self, r):

0 commit comments

Comments
 (0)