From d89ff36caf5672327e0120f1a0726c5a9d52f7cc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:37:36 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_pipeline.py | 8 ++++++-- znsocket/client.py | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py index f4147b0..5a6227e 100644 --- a/tests/test_pipeline.py +++ b/tests/test_pipeline.py @@ -175,6 +175,7 @@ def test_hgetall(client, request): assert pipeline.execute() == [{"bar": "baz", "lorem": "ipsum"}] + @pytest.mark.parametrize("client", ["znsclient", "znsclient_w_redis", "redisclient"]) def test_set_none(client, request): c = request.getfixturevalue(client) @@ -189,7 +190,8 @@ def test_set_none(client, request): # while znsocket only stops operations AFTER the failed operation # assert c.get("foo") is None # REDIS # assert c.get("foo") == "bar" # ZNSOCKET - + + @pytest.mark.parametrize("client", ["znsclient", "znsclient_w_redis"]) def test_set_large_message(client, request, caplog): c = request.getfixturevalue(client) @@ -197,5 +199,7 @@ def test_set_large_message(client, request, caplog): for _ in range(100): pipeline.set("foo", "bar") - with pytest.warns(UserWarning): # assert that the messae is too large and is being split + with pytest.warns( + UserWarning + ): # assert that the messae is too large and is being split assert pipeline.execute() == [True] * 100 diff --git a/znsocket/client.py b/znsocket/client.py index e51d8d7..e0e8b22 100644 --- a/znsocket/client.py +++ b/znsocket/client.py @@ -149,7 +149,10 @@ def _send_message(message) -> list: _handle_error(result) # Process and return results with list comprehension - return [set(res["data"]) if res.get("type") == "set" else res["data"] for res in result["data"]] + return [ + set(res["data"]) if res.get("type") == "set" else res["data"] + for res in result["data"] + ] message = [] results = []