Skip to content

Commit dcae6ec

Browse files
tests: fix health
1 parent dacbe7b commit dcae6ec

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

services/notifications/tests/unit/test_api_rest__health.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@
77
from fastapi.testclient import TestClient
88
from models_library.api_schemas__common.health import HealthCheckGet
99
from models_library.errors import (
10-
POSRGRES_DATABASE_UNHEALTHY_MSG,
1110
RABBITMQ_CLIENT_UNHEALTHY_MSG,
1211
)
13-
from models_library.healthchecks import IsNonResponsive
1412
from pytest_mock import MockerFixture
1513
from simcore_service_notifications.api.rest._health import HealthCheckError
1614

1715
pytest_simcore_core_services_selection = [
18-
"postgres",
1916
"rabbit",
2017
]
2118

@@ -26,23 +23,6 @@ def test_health_ok(test_client: TestClient):
2623
assert HealthCheckGet.model_validate(response.json())
2724

2825

29-
@pytest.fixture
30-
def mock_postgres_liveness(mocker: MockerFixture, test_client: TestClient) -> None:
31-
mocker.patch.object(
32-
test_client.app.state.postgres_liveness,
33-
"_liveness_result",
34-
new=IsNonResponsive(reason="fake"),
35-
)
36-
37-
38-
def test_health_postgres_unhealthy(
39-
mock_postgres_liveness: None, test_client: TestClient
40-
):
41-
with pytest.raises(HealthCheckError) as exc:
42-
test_client.get("/")
43-
assert POSRGRES_DATABASE_UNHEALTHY_MSG in f"{exc.value}"
44-
45-
4626
@pytest.fixture
4727
def mock_rabbit_healthy(mocker: MockerFixture, test_client: TestClient) -> None:
4828
mocker.patch.object(

0 commit comments

Comments
 (0)