summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordvora-h <67596500+dvora-h@users.noreply.github.com>2022-01-04 12:27:37 +0200
committerGitHub <noreply@github.com>2022-01-04 12:27:37 +0200
commit15f315a496c3267c8cbcc6d6d9c6005ea4d4a4d5 (patch)
treef1ca03325138e3492504926f2526fd7c1f73c629
parent231d40275e57bfdf8cc3b98642e886fae9433389 (diff)
downloadredis-py-15f315a496c3267c8cbcc6d6d9c6005ea4d4a4d5.tar.gz
Support test with redis unstable docker (#1850)
-rw-r--r--tests/conftest.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 505a6e4..9ba63d6 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -15,6 +15,7 @@ from redis.retry import Retry
REDIS_INFO = {}
default_redis_url = "redis://localhost:6379/9"
default_redismod_url = "redis://localhost:36379"
+default_redis_unstable_url = "redis://localhost:6378"
# default ssl client ignores verification for the purpose of testing
default_redis_ssl_url = "rediss://localhost:6666"
@@ -54,6 +55,14 @@ def pytest_addoption(parser):
" defaults to `%(default)s`",
)
+ parser.addoption(
+ "--redis-unstable-url",
+ default=default_redis_unstable_url,
+ action="store",
+ help="Redis unstable (latest version) connection string "
+ "defaults to %(default)s`",
+ )
+
def _get_info(redis_url):
client = redis.Redis.from_url(redis_url)
@@ -357,6 +366,13 @@ def master_host(request):
yield parts.hostname, parts.port
+@pytest.fixture()
+def unstable_r(request):
+ url = request.config.getoption("--redis-unstable-url")
+ with _get_client(redis.Redis, request, from_url=url) as client:
+ yield client
+
+
def wait_for_command(client, monitor, command, key=None):
# issue a command with a key name that's local to this process.
# if we find a command with our key before the command we're waiting