summaryrefslogtreecommitdiff
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorAndrew Brookins <andrew.brookins@redislabs.com>2020-07-09 16:15:23 -0700
committerAndrew Brookins <andrew.brookins@redislabs.com>2020-07-09 16:15:23 -0700
commitc31ea12e89141dd90a69180060ae386948831f19 (patch)
treeaceb6becaa0832b791dec5e0e72d89723030949e /tests/conftest.py
parent58ca166a9c7228f24fdd074c4785fe7303851cd4 (diff)
downloadredis-py-c31ea12e89141dd90a69180060ae386948831f19.tar.gz
Pass the master hostname to tests
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 4398175..4a745df 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -24,7 +24,7 @@ def pytest_addoption(parser):
action="store",
help="Redis connection string,"
" defaults to `%(default)s`")
- parser.addoption('--master-host', default=DEFAULT_REDIS_MASTER_HOST,
+ parser.addoption('--redis-master-host', default=DEFAULT_REDIS_MASTER_HOST,
action="store",
help="Redis master hostname,"
" defaults to `%(default)s`")
@@ -163,6 +163,11 @@ def mock_cluster_resp_slaves(request, **kwargs):
return _gen_cluster_mock_resp(r, response)
+@pytest.fixture(scope="module")
+def master_host(request):
+ yield request.config.getoption("--redis-master-host")
+
+
def wait_for_command(client, monitor, command):
# 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