diff --git a/fastapi/routing.py b/fastapi/routing.py index 8f27656d8..b2a8b0188 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -311,6 +311,8 @@ class APIWebSocketRoute(routing.WebSocketRoute): class APIRoute(routing.Route): + _route_full_path_format: str # only for mypy + def __init__( self, path: str, diff --git a/tests/test_custom_route_class.py b/tests/test_custom_route_class.py index 7d8b5f141..f03130aa7 100644 --- a/tests/test_custom_route_class.py +++ b/tests/test_custom_route_class.py @@ -2,7 +2,6 @@ import pytest from fastapi import APIRouter, FastAPI from fastapi.routing import APIRoute from fastapi.testclient import TestClient -from starlette.routing import Route app = FastAPI()