|
15 | 15 | REDIS_INFO = {}
|
16 | 16 | default_redis_url = "redis://localhost:6379/9"
|
17 | 17 | default_redismod_url = "redis://localhost:36379"
|
| 18 | +default_redis_unstable_url = "redis://localhost:6378" |
18 | 19 |
|
19 | 20 | # default ssl client ignores verification for the purpose of testing
|
20 | 21 | default_redis_ssl_url = "rediss://localhost:6666"
|
@@ -54,6 +55,14 @@ def pytest_addoption(parser):
|
54 | 55 | " defaults to `%(default)s`",
|
55 | 56 | )
|
56 | 57 |
|
| 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 | + |
57 | 66 |
|
58 | 67 | def _get_info(redis_url):
|
59 | 68 | client = redis.Redis.from_url(redis_url)
|
@@ -357,6 +366,13 @@ def master_host(request):
|
357 | 366 | yield parts.hostname, parts.port
|
358 | 367 |
|
359 | 368 |
|
| 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 | + |
360 | 376 | def wait_for_command(client, monitor, command, key=None):
|
361 | 377 | # issue a command with a key name that's local to this process.
|
362 | 378 | # if we find a command with our key before the command we're waiting
|
|
0 commit comments