Skip to content

Commit 15f315a

Browse files
authored
Support test with redis unstable docker (#1850)
1 parent 231d402 commit 15f315a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/conftest.py

+16
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
REDIS_INFO = {}
1616
default_redis_url = "redis://localhost:6379/9"
1717
default_redismod_url = "redis://localhost:36379"
18+
default_redis_unstable_url = "redis://localhost:6378"
1819

1920
# default ssl client ignores verification for the purpose of testing
2021
default_redis_ssl_url = "rediss://localhost:6666"
@@ -54,6 +55,14 @@ def pytest_addoption(parser):
5455
" defaults to `%(default)s`",
5556
)
5657

58+
parser.addoption(
59+
"--redis-unstable-url",
60+
default=default_redis_unstable_url,
61+
action="store",
62+
help="Redis unstable (latest version) connection string "
63+
"defaults to %(default)s`",
64+
)
65+
5766

5867
def _get_info(redis_url):
5968
client = redis.Redis.from_url(redis_url)
@@ -357,6 +366,13 @@ def master_host(request):
357366
yield parts.hostname, parts.port
358367

359368

369+
@pytest.fixture()
370+
def unstable_r(request):
371+
url = request.config.getoption("--redis-unstable-url")
372+
with _get_client(redis.Redis, request, from_url=url) as client:
373+
yield client
374+
375+
360376
def wait_for_command(client, monitor, command, key=None):
361377
# issue a command with a key name that's local to this process.
362378
# if we find a command with our key before the command we're waiting

0 commit comments

Comments
 (0)