diff --git a/fastapi/openapi/utils.py b/fastapi/openapi/utils.py index a501ca12bd..04295ff745 100644 --- a/fastapi/openapi/utils.py +++ b/fastapi/openapi/utils.py @@ -3,7 +3,7 @@ import http.client import inspect import warnings from collections.abc import Sequence -from typing import Any, Literal, cast, TYPE_CHECKING +from typing import TYPE_CHECKING, Any, Literal, cast from fastapi import routing from fastapi._compat import ( diff --git a/tests/test_dependency_contextmanager.py b/tests/test_dependency_contextmanager.py index b7c7a627b4..48c3cec66a 100644 --- a/tests/test_dependency_contextmanager.py +++ b/tests/test_dependency_contextmanager.py @@ -1,9 +1,9 @@ import json +from typing import TYPE_CHECKING import pytest from fastapi import BackgroundTasks, Depends, FastAPI from fastapi.testclient import TestClient -from typing import TYPE_CHECKING if TYPE_CHECKING: from fastapi.responses import StreamingResponse diff --git a/tests/test_route_scope.py b/tests/test_route_scope.py index 1e69f38cb1..885b83675d 100644 --- a/tests/test_route_scope.py +++ b/tests/test_route_scope.py @@ -1,7 +1,8 @@ +from typing import TYPE_CHECKING + import pytest from fastapi import FastAPI, Request, WebSocket, WebSocketDisconnect from fastapi.testclient import TestClient -from typing import TYPE_CHECKING if TYPE_CHECKING: from fastapi.routing import APIRoute, APIWebSocketRoute