From ef815b555e9c2e8a57ab56935f8a1e9d1b646343 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 22:35:47 +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 --- fastapi/routing.py | 6 ++---- tests/test_background_tasks_merge.py | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index 1586ee63b5..5176861a77 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -61,9 +61,9 @@ from fastapi.utils import ( is_body_allowed_for_status_code, ) from starlette import routing -from starlette.background import BackgroundTasks as StarletteBackgroundTasks from starlette._exception_handler import wrap_app_handling_exceptions from starlette._utils import is_async_callable +from starlette.background import BackgroundTasks as StarletteBackgroundTasks from starlette.concurrency import run_in_threadpool from starlette.exceptions import HTTPException from starlette.requests import Request @@ -446,9 +446,7 @@ def get_request_handler( merged.tasks.extend(existing.tasks) else: merged.tasks.append(existing) - merged.tasks.extend( - solved_result.background_tasks.tasks - ) + merged.tasks.extend(solved_result.background_tasks.tasks) raw_response.background = merged response = raw_response else: diff --git a/tests/test_background_tasks_merge.py b/tests/test_background_tasks_merge.py index 84565ed5fd..94f2a51bd4 100644 --- a/tests/test_background_tasks_merge.py +++ b/tests/test_background_tasks_merge.py @@ -3,7 +3,6 @@ from fastapi.testclient import TestClient from starlette.background import BackgroundTask from starlette.responses import JSONResponse - results: list[str] = []