Skip to content

CosmoTech_Acceleration_Library.Modelops.core.tests.redis_test

redis_test

redis_service(docker_ip, docker_services)

ensure redis is up and running

Source code in CosmoTech_Acceleration_Library/Modelops/core/tests/redis_test.py
22
23
24
25
26
27
28
29
30
31
@pytest.fixture(scope='session')
def redis_service(docker_ip, docker_services):
    """ensure redis is up and running"""

    host = docker_ip
    port = docker_services.port_for("redis", 6379)
    redis_client = redis.Redis(host=host, port=port)

    docker_services.wait_until_responsive(timeout=5, pause=0.2, check=redis_client.ping)
    return {"host": host, "port": port}