summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordvora-h <67596500+dvora-h@users.noreply.github.com>2023-05-08 14:15:39 +0300
committerGitHub <noreply@github.com>2023-05-08 14:15:39 +0300
commit984b733d52b44ec75e2c9ff53689a7b6fa86d719 (patch)
tree741df4dbba0bd299c13a30cf4892a89fa7434a11 /tests
parent8c06d67f574bef941f7e19b1b2b36e767ed42b6d (diff)
downloadredis-py-984b733d52b44ec75e2c9ff53689a7b6fa86d719.tar.gz
fix create single_connection_client from url (#2752)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_asyncio/test_connection.py6
-rw-r--r--tests/test_connection.py8
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_asyncio/test_connection.py b/tests/test_asyncio/test_connection.py
index e49dd42..158b854 100644
--- a/tests/test_asyncio/test_connection.py
+++ b/tests/test_asyncio/test_connection.py
@@ -271,3 +271,9 @@ async def test_connection_disconect_race(parser_class):
vals = await asyncio.gather(do_read(), do_close())
assert vals == [b"Hello, World!", None]
+
+
+@pytest.mark.onlynoncluster
+def test_create_single_connection_client_from_url():
+ client = Redis.from_url("redis://localhost:6379/0?", single_connection_client=True)
+ assert client.single_connection_client is True
diff --git a/tests/test_connection.py b/tests/test_connection.py
index 75ba738..31268a9 100644
--- a/tests/test_connection.py
+++ b/tests/test_connection.py
@@ -205,3 +205,11 @@ def test_pack_command(Class):
actual = Class().pack_command(*cmd)[0]
assert actual == expected, f"actual = {actual}, expected = {expected}"
+
+
+@pytest.mark.onlynoncluster
+def test_create_single_connection_client_from_url():
+ client = redis.Redis.from_url(
+ "redis://localhost:6379/0?", single_connection_client=True
+ )
+ assert client.connection is not None