From 29a27731e32a454e011c2adea126e2687fdd621f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:34:10 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20format?= =?UTF-8?q?=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/routing.py | 7 +++---- tests/test_annotated.py | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index 1df3482ce..54d53bbbf 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -3,16 +3,14 @@ import dataclasses import email.message import inspect import json -from contextlib import AsyncExitStack, asynccontextmanager +from contextlib import AsyncExitStack from enum import Enum, IntEnum from typing import ( Any, - AsyncIterator, Callable, Coroutine, Dict, List, - Mapping, Optional, Sequence, Set, @@ -69,7 +67,7 @@ from starlette.routing import ( websocket_session, ) from starlette.routing import Mount as Mount # noqa -from starlette.types import AppType, ASGIApp, Lifespan, Scope +from starlette.types import ASGIApp, Lifespan, Scope from starlette.websockets import WebSocket from typing_extensions import Annotated, Doc, deprecated # type: ignore [attr-defined] @@ -120,6 +118,7 @@ def _prepare_response_content( return dataclasses.asdict(res) return res + async def serialize_response( *, field: Optional[ModelField] = None, diff --git a/tests/test_annotated.py b/tests/test_annotated.py index 26a608822..2222be978 100644 --- a/tests/test_annotated.py +++ b/tests/test_annotated.py @@ -75,6 +75,7 @@ foo_is_short = { ] } + @pytest.mark.parametrize( "path,expected_status,expected_response", [