Fix testutils redis mock (#4586)

This commit is contained in:
Richard Schreiber
2024-10-29 16:37:06 +01:00
committed by GitHub
parent a31f624417
commit f9502a3212

View File

@@ -40,7 +40,7 @@ def mocker_context():
def get_redis_connection(alias="default", write=True):
worker_id = os.environ.get("PYTEST_XDIST_WORKER")
if worker_id.startswith("gw"):
if worker_id and worker_id.startswith("gw"):
redis_port = 1000 + int(worker_id.replace("gw", ""))
else:
redis_port = 1000