diff options
-rw-r--r-- | tests/conftest.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index be5f9f2..d8aca81 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,7 @@ """Set up fixtures for tests""" import io import os +import shutil import socket import subprocess from contextlib import closing @@ -28,8 +29,7 @@ def redis_url(): "Fixture to launch a new redis instance and return appropriate URI" port = next(# pylint: disable=[stop-iteration-return] port for port in range(6379,65535) if not is_port_in_use(port)) - redis_path = f"{os.getenv('GUIX_ENVIRONMENT')}/bin/redis-server" - command = [redis_path, "--port", str(port)] + command = [shutil.which("redis-server"), "--port", str(port)] process = subprocess.Popen(command) # pylint: disable=[consider-using-with] yield f"redis://localhost:{port}" process.kill() |