From 17377b78c073faaf87c7a26e51449a5c6ace487f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 10 Oct 2025 14:47:26 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Update=20tests=20with=20skip=20flag?= =?UTF-8?q?=20for=20Pydantic=20v1=20in=20Python=203.14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_compat.py | 3 ++- tests/utils.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_compat.py b/tests/test_compat.py index 095f6f3c2..f79dbdabc 100644 --- a/tests/test_compat.py +++ b/tests/test_compat.py @@ -14,7 +14,7 @@ from fastapi.testclient import TestClient from pydantic import BaseModel, ConfigDict from pydantic.fields import FieldInfo -from .utils import needs_pydanticv2 +from .utils import needs_py_lt_314, needs_pydanticv2 @needs_pydanticv2 @@ -133,6 +133,7 @@ def test_is_uploadfile_sequence_annotation(): assert is_uploadfile_sequence_annotation(Union[List[str], List[UploadFile]]) +@needs_py_lt_314 def test_is_pv1_scalar_field(): # For coverage class Model(v1.BaseModel): diff --git a/tests/utils.py b/tests/utils.py index ae9543e3b..f11ce9e2c 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -8,6 +8,9 @@ needs_py39 = pytest.mark.skipif(sys.version_info < (3, 9), reason="requires pyth needs_py310 = pytest.mark.skipif( sys.version_info < (3, 10), reason="requires python3.10+" ) +needs_py_lt_314 = pytest.mark.skipif( + sys.version_info > (3, 13), reason="requires python3.13-" +) needs_pydanticv2 = pytest.mark.skipif(not PYDANTIC_V2, reason="requires Pydantic v2") needs_pydanticv1 = pytest.mark.skipif(PYDANTIC_V2, reason="requires Pydantic v1")