From 5e432a2131f37098a2d25c0be4e15f536e70686c Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Wed, 5 Feb 2025 13:16:37 +0100 Subject: [PATCH] [FIX] Test postgres --- tests/test_postgres.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/tests/test_postgres.py b/tests/test_postgres.py index d54f263d..04efc55d 100644 --- a/tests/test_postgres.py +++ b/tests/test_postgres.py @@ -42,28 +42,6 @@ def _get_db_service_name(dc: DockerClient) -> str: return "db" -def _get_db_service_name(dc: DockerClient) -> str: - """ - Use python-on-whales to retrieve the final Compose configuration - and return the DB service name that ends with '-db'. Fallback to - any service containing 'db' or 'postgres'. Finally, fallback to 'db'. - """ - config_data = dc.compose.config() # Returns a dict with { "services": {...}, ... } - services_dict = config_data["services"] - # First pass: Look for a service name that exactly ends with '-db' - for svc_name in services_dict: - if svc_name.lower().endswith("-db"): - return svc_name - - # Second pass: Fallback to any name containing 'db' or 'postgres' - for svc_name in services_dict: - if "postgres" in svc_name.lower() or "db" in svc_name.lower(): - return svc_name - - # Final fallback - return "db" - - @pytest.mark.parametrize("dbver", ("oldest", "latest")) def test_postgresql_client_versions( cloned_template: Path,