From d3156706d0dc70b767fe710f7d966df3400499c5 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Fri, 4 Jul 2025 21:22:58 +0200 Subject: [PATCH] Simplify test description --- tests/test_get_model_definitions_formfeed_escape.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/test_get_model_definitions_formfeed_escape.py b/tests/test_get_model_definitions_formfeed_escape.py index c4045830e..4966ae4ca 100644 --- a/tests/test_get_model_definitions_formfeed_escape.py +++ b/tests/test_get_model_definitions_formfeed_escape.py @@ -164,12 +164,9 @@ class SortedTypeSet(Set[Type[Any]]): @pytest.mark.parametrize("sort_reversed", [True, False]) def test_model_description_escaped_with_formfeed(sort_reversed: bool): """ - Ensure that openapi model descriptions that originate from Pydantic docstrings always truncate the docstring to text - that falls before the formfeed (\f) character. This feature was introduced in (https://github.com/tiangolo/fastapi/pull/3032). - When originally introduced, there was a possibility that the truncation may be ignored depending on the order in which - the models got processed. This created non-deterministic errors, since Pydantic model processing uses unordered sets - and model ordering may differ from one invocation to the next. - This test verifies that (\f) escape of docstrings works in all possible orderings of our two Pydantic model classes. + Regression test for bug fixed by https://github.com/fastapi/fastapi/pull/6039. + + Test `get_model_definitions` with models passed in different order. """ all_fields = fastapi.openapi.utils.get_fields_from_routes(app.routes)