Browse Source

🎨 Auto format

pull/15010/head
pre-commit-ci-lite[bot] 5 months ago
committed by GitHub
parent
commit
ef815b555e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      fastapi/routing.py
  2. 1
      tests/test_background_tasks_merge.py

6
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:

1
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] = []

Loading…
Cancel
Save