From 21e19bf3a5ad563326cb8fd5a5e2f85bebc428d9 Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Fri, 1 May 2026 13:59:10 -0700 Subject: [PATCH] test(health): tighten happy-path 200 assertions to exact equality Per review: `assert response.status_code != 503` is satisfied by 404, 500, or any other non-503 code, so a regression that returned the wrong non-503 status would slip through. Switch to `== 200` so the assertions verify the actual expected status, not just the absence of one specific failure. --- .../proxy/health_endpoints/test_health_endpoints.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py b/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py index d5102daa43..6eb9d03c0e 100644 --- a/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py +++ b/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py @@ -1331,7 +1331,7 @@ async def test_health_endpoint_returns_200_when_requested_model_has_healthy_endp model="model-a", ) - assert response.status_code != 503 + assert response.status_code == 200 @pytest.mark.asyncio @@ -1395,7 +1395,7 @@ async def test_health_endpoint_no_model_param_returns_200_even_when_zero_healthy model_id=None, ) - assert response.status_code != 503 + assert response.status_code == 200 @pytest.mark.asyncio @@ -1447,7 +1447,7 @@ async def test_health_readiness_returns_200_when_db_connected(): with patch("litellm.proxy.proxy_server.prisma_client", mock_prisma): result = await health_readiness(response=response) - assert response.status_code != 503 + assert response.status_code == 200 assert result["db"] == "connected" @@ -1466,7 +1466,7 @@ async def test_health_readiness_returns_200_when_no_db_configured(): with patch("litellm.proxy.proxy_server.prisma_client", None): result = await health_readiness(response=response) - assert response.status_code != 503 + assert response.status_code == 200 assert result["db"] == "Not connected"