15
0
Files
python-dynaconf/redis-server-url.patch
Tomáš Chvátal 80d13f36e2 Accepting request 825159 from home:jayvdb:branches:devel:languages:python
- Devendor the runtime package
- Activate redis tests using redis-server-url.patch
- Remove box-4.0.patch merged upstream
- Update to v3.0.0
  * Breaking change: Envless by default
  * See https://github.com/rochacbruno/dynaconf/blob/master/CHANGELOG.md
    for other changes

OBS-URL: https://build.opensuse.org/request/show/825159
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dynaconf?expand=0&rev=14
2020-08-10 11:17:10 +00:00

34 lines
1.0 KiB
Diff

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