Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1264 from aio-libs/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
seandstewart committed Feb 4, 2022
2 parents 8230473 + 40dd72f commit f017394
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/psf/black
rev: '21.12b0'
rev: '22.1.0'
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
Expand Down Expand Up @@ -55,7 +55,7 @@ repos:
- id: detect-private-key
exclude: ^examples|(?:tests/ssl)/
- repo: https://github.com/asottile/pyupgrade
rev: 'v2.29.1'
rev: 'v2.31.0'
hooks:
- id: pyupgrade
args: ['--py36-plus', '--keep-mock']
Expand Down
2 changes: 1 addition & 1 deletion aioredis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ def __init__(
max_connections: Optional[int] = None,
**connection_kwargs,
):
max_connections = max_connections or 2 ** 31
max_connections = max_connections or 2**31
if not isinstance(max_connections, int) or max_connections < 0:
raise ValueError('"max_connections" must be a positive integer')

Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ async def wait_for_command(client: aioredis.Redis, monitor: Monitor, command: st
if StrictVersion(redis_version) >= StrictVersion("5.0.0"):
id_str = str(await client.client_id())
else:
id_str = "%08x" % random.randrange(2 ** 32)
id_str = "%08x" % random.randrange(2**32)
key = "__REDIS-PY-%s__" % id_str
await client.get(key)
while True:
Expand Down
21 changes: 9 additions & 12 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2393,7 +2393,7 @@ async def test_xack(self, r: aioredis.Redis):
async def test_xadd(self, r: aioredis.Redis):
stream = "stream"
message_id = await r.xadd(stream, {"foo": "bar"})
assert re.match(br"[0-9]+\-[0-9]+", message_id)
assert re.match(rb"[0-9]+\-[0-9]+", message_id)

# explicit message id
message_id = b"9999999999999999999-0"
Expand Down Expand Up @@ -2432,17 +2432,14 @@ async def test_xclaim(self, r: aioredis.Redis):

# reclaim the message as consumer1, but use the justid argument
# which only returns message ids
assert (
await r.xclaim(
stream,
group,
consumer1,
min_idle_time=0,
message_ids=(message_id,),
justid=True,
)
== [message_id]
)
assert await r.xclaim(
stream,
group,
consumer1,
min_idle_time=0,
message_ids=(message_id,),
justid=True,
) == [message_id]

@skip_if_server_version_lt("5.0.0")
async def test_xclaim_trimmed(self, r: aioredis.Redis):
Expand Down

0 comments on commit f017394

Please sign in to comment.