15
0
Files
python-dynaconf/redis-server-url.patch

34 lines
1.0 KiB
Diff
Raw Normal View History

diff --git a/tests/test_redis.py b/tests/test_redis.py
index 34e7c2e..7e3005c 100644
--- a/tests/test_redis.py
+++ b/tests/test_redis.py
@@ -15,14 +15,20 @@ def custom_checker(ip_address, port):
return True
-@pytest.fixture(scope="module")
-def docker_redis(docker_services):
- docker_services.start("redis")
- public_port = docker_services.wait_for_service(
- "redis", 6379, check_server=custom_checker
- )
- url = f"http://{docker_services.docker_ip}:{public_port}"
- return url
+REDIS_URL = os.environ.get('REDIS_URL', None)
+if REDIS_URL:
+ @pytest.fixture(scope="module")
+ def docker_redis():
+ return REDIS_URL
+else:
+ @pytest.fixture(scope="module")
+ def docker_redis(docker_services):
+ docker_services.start("redis")
+ public_port = docker_services.wait_for_service(
+ "redis", 6379, check_server=custom_checker
+ )
+ url = f"http://{docker_services.docker_ip}:{public_port}"
+ return url
@pytest.mark.integration