From: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 13:00:27 +0000 (+0000) Subject: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=55931329eb4dc809b648322173afedd28a75cdb3;p=thirdparty%2Ffastapi%2Ffastapi.git 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks --- diff --git a/docs_src/custom_response/tutorial009c.py b/docs_src/custom_response/tutorial009c.py index 337f0cd20..6ac4e2ab7 100644 --- a/docs_src/custom_response/tutorial009c.py +++ b/docs_src/custom_response/tutorial009c.py @@ -10,6 +10,7 @@ class CustomORJSONResponse(Response): def render(self, content: Any) -> bytes: import orjson + assert orjson is not None, "orjson must be installed" return orjson.dumps(content, option=orjson.OPT_INDENT_2) diff --git a/tests/test_default_response_class.py b/tests/test_default_response_class.py index bd37e13e0..821a71373 100644 --- a/tests/test_default_response_class.py +++ b/tests/test_default_response_class.py @@ -1,7 +1,6 @@ from typing import Any import pytest - from fastapi import APIRouter, FastAPI from fastapi.responses import HTMLResponse, JSONResponse, PlainTextResponse from fastapi.testclient import TestClient @@ -12,6 +11,7 @@ class ORJSONResponse(JSONResponse): def render(self, content: Any) -> bytes: import orjson + return orjson.dumps(content)