diff --git a/tests/test_litellm/proxy/auth/test_resolvers_grants.py b/tests/test_litellm/proxy/auth/test_resolvers_grants.py index e61269ec1c7..8bf8b42889a 100644 --- a/tests/test_litellm/proxy/auth/test_resolvers_grants.py +++ b/tests/test_litellm/proxy/auth/test_resolvers_grants.py @@ -181,6 +181,8 @@ class _UnreachableMembershipPrisma: async def find_unique(where: dict[str, dict[str, str]], include: dict[str, bool]) -> None: raise httpx.ConnectError("All connection attempts failed") + replica_db = db + async def test_resolve_marks_a_membership_read_that_hits_a_db_outage_as_degraded(): loaders = _Loaders(user=_user(), team=_team()) diff --git a/tests/test_litellm/proxy/batches_endpoints/test_endpoints.py b/tests/test_litellm/proxy/batches_endpoints/test_endpoints.py index a7abcf4d3b2..118ff186a6b 100644 --- a/tests/test_litellm/proxy/batches_endpoints/test_endpoints.py +++ b/tests/test_litellm/proxy/batches_endpoints/test_endpoints.py @@ -1165,6 +1165,7 @@ async def test_create__uses_acreate_batch_route_type(harness, openai_env_creds): def install_managed_files_hook(harness: Harness) -> AsyncMock: prisma_client = AsyncMock() + prisma_client.replica_db = prisma_client.db managed_files = _PROXY_LiteLLMManagedFiles(MagicMock(async_set_cache=AsyncMock()), prisma_client=prisma_client) harness.logging.post_call_success_hook = AsyncMock(side_effect=managed_files.async_post_call_success_hook) harness.router.model_list = [] @@ -1182,7 +1183,6 @@ def assert_ownership_registered_for_team_a(prisma_client: AsyncMock, batch_id: s assert created["created_by"] == "user_a" assert created["team_id"] == "team_a" prisma_client.db.litellm_managedobjecttable.update_many.assert_not_awaited() - prisma_client.replica_db = prisma_client.db @pytest.mark.asyncio diff --git a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py index 5612a76a6fd..6069c307b8e 100644 --- a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py +++ b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py @@ -4687,6 +4687,7 @@ def _setup_unscoped_list_files_route_over_real_hook( internal_usage_cache=MagicMock(), prisma_client=MagicMock() ) managed_files.prisma_client.db.litellm_managedfiletable = _ManagedFileTableOverRows(rows) + managed_files.prisma_client.replica_db = managed_files.prisma_client.db proxy_logging_obj = setup_proxy_logging_object(monkeypatch, llm_router) proxy_logging_obj.proxy_hook_mapping["managed_files"] = managed_files