From 1e9741df66c95792c33a7078866cb822672de006 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Jul 2025 16:40:50 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20format?= =?UTF-8?q?=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/openapi/docs.py | 2 +- tests/test_local_docs.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fastapi/openapi/docs.py b/fastapi/openapi/docs.py index 73eb477d9..af2e10f30 100644 --- a/fastapi/openapi/docs.py +++ b/fastapi/openapi/docs.py @@ -229,7 +229,7 @@ def get_redoc_html( config_string = "" if redoc_ui_parameters: for key, value in redoc_ui_parameters.items(): - config_string += f" {key}=\"{value}\"" + config_string += f' {key}="{value}"' html = f""" diff --git a/tests/test_local_docs.py b/tests/test_local_docs.py index fde018d89..cddd1dee8 100644 --- a/tests/test_local_docs.py +++ b/tests/test_local_docs.py @@ -69,13 +69,16 @@ def test_google_fonts_in_generated_redoc(): def test_generated_redoc_with_parameters(): body_with_parameters = get_redoc_html( - openapi_url="/docs", title="title", with_google_fonts=False, redoc_ui_parameters={"disable-search": "true"} + openapi_url="/docs", + title="title", + with_google_fonts=False, + redoc_ui_parameters={"disable-search": "true"}, ).body.decode() - assert "disable-search=\"true\"" in body_with_parameters + assert 'disable-search="true"' in body_with_parameters def test_generated_redoc_without_parameters(): body_without_parameters = get_redoc_html( openapi_url="/docs", title="title", with_google_fonts=False ).body.decode() - assert "disable-search=\"true\"" not in body_without_parameters + assert 'disable-search="true"' not in body_without_parameters