litellm/tests/unit/proxy/deps/test_database.py
yujonglee c919f3d9f3
refactor(proxy): inject database repositories through per-repository dependencies (#48507)
* refactor(proxy): inject database repositories through per-repository dependencies

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(proxy): model Prisma client cleanup

* test(rust): include NativeDatabase in bridge API surface

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-30 22:57:54 +00:00

13 lines
403 B
Python

from typing import Final
import pytest
from starlette.requests import Request
from litellm.proxy.deps.database import DatabaseStateMissingError, get_database
@pytest.mark.asyncio
async def test_missing_lifespan_is_not_treated_as_a_disabled_database():
request: Final = Request({"type": "http", "state": {}})
with pytest.raises(DatabaseStateMissingError):
await get_database(request)