Skip to content

Commit cacf5bc

Browse files
committed
Fixed Python 3.8 compatibility in test_init_slots_cache_slots_collision()
1 parent f2e774c commit cacf5bc

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

tests/test_anyio/test_cluster.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2552,17 +2552,15 @@ async def mocked_execute_command(self, *args, **kwargs):
25522552
elif args[1] == "cluster-require-full-coverage":
25532553
return {"cluster-require-full-coverage": "yes"}
25542554

2555-
with (
2556-
patch.object(ClusterNode, "execute_command", mocked_execute_command),
2557-
pytest.raises(
2555+
with patch.object(ClusterNode, "execute_command", mocked_execute_command):
2556+
with pytest.raises(
25582557
RedisClusterException,
25592558
match="^startup_nodes could not agree on a valid slots cache",
2560-
),
2561-
):
2562-
node_1 = ClusterNode("127.0.0.1", 7000)
2563-
node_2 = ClusterNode("127.0.0.1", 7001)
2564-
async with RedisCluster(startup_nodes=[node_1, node_2]):
2565-
...
2559+
):
2560+
node_1 = ClusterNode("127.0.0.1", 7000)
2561+
node_2 = ClusterNode("127.0.0.1", 7001)
2562+
async with RedisCluster(startup_nodes=[node_1, node_2]):
2563+
...
25662564

25672565
async def test_cluster_one_instance(self) -> None:
25682566
"""

0 commit comments

Comments
 (0)