From a2551cdb4c11a5875ff54b38b19dfa4d76e3756c Mon Sep 17 00:00:00 2001 From: Arya Rizky Date: Tue, 12 May 2026 19:00:02 +0700 Subject: [PATCH] fix: move stray imports to top of test file (E402) --- tests/test_custom_route_class.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_custom_route_class.py b/tests/test_custom_route_class.py index e503f4dd28..31532c90c8 100644 --- a/tests/test_custom_route_class.py +++ b/tests/test_custom_route_class.py @@ -4,8 +4,9 @@ from fastapi.routing import APIRoute from fastapi.testclient import TestClient from inline_snapshot import snapshot from starlette.routing import Route +from typing import Any +from collections.abc import Callable, Sequence -from typing import Any, Callable, Sequence app = FastAPI() @@ -122,6 +123,8 @@ def test_openapi_schema(): ) + + class LegacyAPIRoute(APIRoute): """Route subclass with explicit __init__ matching the pre-strict_content_type signature.""" @@ -201,3 +204,4 @@ def test_legacy_route_class_with_explicit_init() -> None: response = client.get("/items") assert response.status_code == 200 assert response.json() == {"items": []} +