From 3d7667ae1d8ac23e7e9dfb050743df0e056cc490 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 02:25:38 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Auto=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_router_mount.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_router_mount.py b/tests/test_router_mount.py index 0a36544c9f..7fffe75cee 100644 --- a/tests/test_router_mount.py +++ b/tests/test_router_mount.py @@ -1,20 +1,23 @@ -from fastapi import FastAPI, APIRouter -from fastapi.testclient import TestClient +from fastapi import APIRouter, FastAPI app = FastAPI() api_router = APIRouter(prefix="/api") + @api_router.get("/app") def read_main(): return {"message": "Hello World from main app"} + subapi = FastAPI() + @subapi.get("/sub") def read_sub(): return {"message": "Hello World from sub API"} + api_router.mount("/subapi", subapi) # ← moved up -app.include_router(api_router) # ← now after +app.include_router(api_router) # ← now after -print("All tests passed.") \ No newline at end of file +print("All tests passed.")