Silence the deprecation warnings our own code raises

Starlette renamed HTTP_422_UNPROCESSABLE_ENTITY to HTTP_422_UNPROCESSABLE_CONTENT
and now warns on the old spelling; the value is unchanged at 422, so the 20 call
sites in the routers move over with no wire-format or frontend impact.

Alembic >=1.16 supersedes version_path_separator with path_separator, which
governs both prepend_sys_path and version_locations, and warns when it is absent.

Together this takes pytest from 26 deprecation warnings to 6. The remainder are
slowapi calling asyncio.iscoroutinefunction; they are left visible deliberately,
with no filterwarnings entry, as a reminder to revisit once upstream ships a fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-20 18:48:02 +02:00
parent fc90cf9a5f
commit 64734ae6e7
13 changed files with 22 additions and 22 deletions
+3 -3
View File
@@ -48,7 +48,7 @@ def _to_http_error(exc: NotFoundError | ValidationError) -> HTTPException:
code = (
status.HTTP_404_NOT_FOUND
if isinstance(exc, NotFoundError)
else status.HTTP_422_UNPROCESSABLE_ENTITY
else status.HTTP_422_UNPROCESSABLE_CONTENT
)
if exc.message_key:
return HTTPException(code, detail={"message_key": exc.message_key, "data": exc.data})
@@ -91,7 +91,7 @@ async def update_workspace(
code = (
status.HTTP_404_NOT_FOUND
if isinstance(exc, NotFoundError)
else status.HTTP_422_UNPROCESSABLE_ENTITY
else status.HTTP_422_UNPROCESSABLE_CONTENT
)
raise HTTPException(code, str(exc)) from exc
return WorkspaceResponse.from_entity(ws)
@@ -220,6 +220,6 @@ async def revoke_invitation(
code = (
status.HTTP_404_NOT_FOUND
if isinstance(exc, NotFoundError)
else status.HTTP_422_UNPROCESSABLE_ENTITY
else status.HTTP_422_UNPROCESSABLE_CONTENT
)
raise HTTPException(code, str(exc)) from exc