From 3bb7ba03ffeddc84b3856eb3736e8c52379f0ca9 Mon Sep 17 00:00:00 2001 From: Jonas Dittrich Date: Mon, 12 May 2025 09:33:03 +0200 Subject: [PATCH] tests: use `sorted(...)` instead of `.sort()` Signed-off-by: Jonas Dittrich --- tests/test_asyncio/test_cluster.py | 2 +- tests/test_asyncio/test_search.py | 2 +- tests/test_cluster.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_asyncio/test_cluster.py b/tests/test_asyncio/test_cluster.py index 2020554f..e9437755 100644 --- a/tests/test_asyncio/test_cluster.py +++ b/tests/test_asyncio/test_cluster.py @@ -2620,7 +2620,7 @@ async def test_init_slots_dynamic_startup_nodes(self, dynamic_startup_nodes): ] startup_nodes = list(rc.nodes_manager.startup_nodes.keys()) if dynamic_startup_nodes is True: - assert startup_nodes.sort() == discovered_nodes.sort() + assert sorted(startup_nodes) == sorted(discovered_nodes) else: assert startup_nodes == ["my@DNS.com:7000"] diff --git a/tests/test_asyncio/test_search.py b/tests/test_asyncio/test_search.py index 17707032..20c9799f 100644 --- a/tests/test_asyncio/test_search.py +++ b/tests/test_asyncio/test_search.py @@ -827,7 +827,7 @@ async def test_tags(decoded_r: valkey.Valkey): assert 1 == res.total q2 = await decoded_r.ft().tagvals("tags") - assert (tags.split(",") + tags2.split(",")).sort() == q2.sort() + assert sorted(tags.split(",") + tags2.split(",")) == sorted(q2) else: res = await decoded_r.ft().search(q) assert 1 == res["total_results"] diff --git a/tests/test_cluster.py b/tests/test_cluster.py index f8217e3d..7fca0409 100644 --- a/tests/test_cluster.py +++ b/tests/test_cluster.py @@ -2815,7 +2815,7 @@ def test_init_slots_dynamic_startup_nodes(self, dynamic_startup_nodes): ] startup_nodes = list(rc.nodes_manager.startup_nodes.keys()) if dynamic_startup_nodes is True: - assert startup_nodes.sort() == discovered_nodes.sort() + assert sorted(startup_nodes) == sorted(discovered_nodes) else: assert startup_nodes == ["my@DNS.com:7000"]