From 8c8addfb59fd4dcf1142931f7983eb68b48f4be4 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 18 Dec 2025 22:53:46 +0100 Subject: [PATCH] Fix applying `needs_pydanticv2` to modules --- tests/test_tutorial/test_body/test_tutorial002.py | 11 ++++++----- tests/test_tutorial/test_body/test_tutorial003.py | 11 ++++++----- tests/test_tutorial/test_body/test_tutorial004.py | 11 ++++++----- .../test_body_multiple_params/test_tutorial002.py | 2 +- .../test_body_multiple_params/test_tutorial004.py | 2 +- .../test_body_multiple_params/test_tutorial005.py | 2 +- .../test_tutorial001_tutorial002_tutorial003.py | 2 +- .../test_body_nested_models/test_tutorial004.py | 2 +- .../test_body_nested_models/test_tutorial005.py | 2 +- .../test_body_nested_models/test_tutorial006.py | 2 +- .../test_body_nested_models/test_tutorial007.py | 2 +- .../test_body_nested_models/test_tutorial008.py | 2 +- .../test_body_updates/test_tutorial002.py | 13 +++++++------ .../test_tutorial001_tutorial001_02.py | 2 +- .../test_tutorial002_tutorial003_tutorial004.py | 2 +- .../test_dependencies/test_tutorial005.py | 2 +- .../test_dependencies/test_tutorial011.py | 2 +- .../test_tutorial/test_encoder/test_tutorial001.py | 2 +- .../test_tutorial001_tutorial002.py | 11 ++++++----- .../test_tutorial001.py | 2 +- .../test_tutorial002.py | 2 +- .../test_tutorial003_tutorial004.py | 2 +- .../test_path_params/test_tutorial002.py | 4 ++++ .../test_tutorial001.py | 2 +- .../test_tutorial002_tutorial003.py | 2 +- .../test_tutorial004.py | 2 +- .../test_tutorial005.py | 2 +- .../test_tutorial006.py | 2 +- .../test_query_params/test_tutorial001.py | 2 +- .../test_query_params/test_tutorial002.py | 2 +- .../test_query_params/test_tutorial003.py | 2 +- .../test_query_params/test_tutorial004.py | 2 +- .../test_tutorial001.py | 2 +- .../test_tutorial002.py | 2 +- .../test_tutorial003.py | 2 +- .../test_tutorial004.py | 11 ++++++----- .../test_tutorial005.py | 2 +- .../test_tutorial006.py | 2 +- .../test_tutorial006c.py | 2 +- .../test_tutorial007.py | 2 +- .../test_tutorial008.py | 2 +- .../test_tutorial009.py | 2 +- .../test_response_directly/test_tutorial002.py | 2 +- .../test_tutorial001_tutorial001_01.py | 2 +- .../test_response_model/test_tutorial002.py | 2 +- .../test_schema_extra_example/test_tutorial002.py | 2 +- .../test_schema_extra_example/test_tutorial003.py | 2 +- .../test_tutorial/test_security/test_tutorial002.py | 2 +- .../test_tutorial/test_security/test_tutorial004.py | 2 +- tests/test_tutorial/test_settings/test_app01.py | 2 +- 50 files changed, 84 insertions(+), 74 deletions(-) diff --git a/tests/test_tutorial/test_body/test_tutorial002.py b/tests/test_tutorial/test_body/test_tutorial002.py index 8a1a4af16..d4d425269 100644 --- a/tests/test_tutorial/test_body/test_tutorial002.py +++ b/tests/test_tutorial/test_body/test_tutorial002.py @@ -7,11 +7,12 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 # Remove when deprecating Pydantic v1 -pytestmark = pytest.mark.filterwarnings( - "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning" -) - -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = [ + pytest.mark.filterwarnings( + "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning" + ), + needs_pydanticv2, +] @pytest.fixture( diff --git a/tests/test_tutorial/test_body/test_tutorial003.py b/tests/test_tutorial/test_body/test_tutorial003.py index 0968f2de3..1a9fed860 100644 --- a/tests/test_tutorial/test_body/test_tutorial003.py +++ b/tests/test_tutorial/test_body/test_tutorial003.py @@ -6,11 +6,12 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 # Remove when deprecating Pydantic v1 -pytestmark = pytest.mark.filterwarnings( - "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning" -) - -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = [ + pytest.mark.filterwarnings( + "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning" + ), + needs_pydanticv2, +] @pytest.fixture( diff --git a/tests/test_tutorial/test_body/test_tutorial004.py b/tests/test_tutorial/test_body/test_tutorial004.py index e997f11cf..3217f3a24 100644 --- a/tests/test_tutorial/test_body/test_tutorial004.py +++ b/tests/test_tutorial/test_body/test_tutorial004.py @@ -6,11 +6,12 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 # Remove when deprecating Pydantic v1 -pytestmark = pytest.mark.filterwarnings( - "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning" -) - -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = [ + pytest.mark.filterwarnings( + "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning" + ), + needs_pydanticv2, +] @pytest.fixture( diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial002.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial002.py index 6146dec86..476f7916d 100644 --- a/tests/test_tutorial/test_body_multiple_params/test_tutorial002.py +++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial002.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial004.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial004.py index ea05b133b..4a0767d3a 100644 --- a/tests/test_tutorial/test_body_multiple_params/test_tutorial004.py +++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial004.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial005.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial005.py index 19bfa2e81..8f2cc9920 100644 --- a/tests/test_tutorial/test_body_multiple_params/test_tutorial005.py +++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial005.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_body_nested_models/test_tutorial001_tutorial002_tutorial003.py b/tests/test_tutorial/test_body_nested_models/test_tutorial001_tutorial002_tutorial003.py index 07bf83d0c..8d9f5b917 100644 --- a/tests/test_tutorial/test_body_nested_models/test_tutorial001_tutorial002_tutorial003.py +++ b/tests/test_tutorial/test_body_nested_models/test_tutorial001_tutorial002_tutorial003.py @@ -6,7 +6,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 UNTYPED_LIST_SCHEMA = {"type": "array", "items": {}} diff --git a/tests/test_tutorial/test_body_nested_models/test_tutorial004.py b/tests/test_tutorial/test_body_nested_models/test_tutorial004.py index 036c1879a..da80333ab 100644 --- a/tests/test_tutorial/test_body_nested_models/test_tutorial004.py +++ b/tests/test_tutorial/test_body_nested_models/test_tutorial004.py @@ -6,7 +6,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_body_nested_models/test_tutorial005.py b/tests/test_tutorial/test_body_nested_models/test_tutorial005.py index 39a94079d..9de2df69c 100644 --- a/tests/test_tutorial/test_body_nested_models/test_tutorial005.py +++ b/tests/test_tutorial/test_body_nested_models/test_tutorial005.py @@ -6,7 +6,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_body_nested_models/test_tutorial006.py b/tests/test_tutorial/test_body_nested_models/test_tutorial006.py index 8c8422f6b..65d5e7c05 100644 --- a/tests/test_tutorial/test_body_nested_models/test_tutorial006.py +++ b/tests/test_tutorial/test_body_nested_models/test_tutorial006.py @@ -6,7 +6,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_body_nested_models/test_tutorial007.py b/tests/test_tutorial/test_body_nested_models/test_tutorial007.py index 97807aa00..717feaee0 100644 --- a/tests/test_tutorial/test_body_nested_models/test_tutorial007.py +++ b/tests/test_tutorial/test_body_nested_models/test_tutorial007.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_body_nested_models/test_tutorial008.py b/tests/test_tutorial/test_body_nested_models/test_tutorial008.py index 2d068c302..ca6b78afe 100644 --- a/tests/test_tutorial/test_body_nested_models/test_tutorial008.py +++ b/tests/test_tutorial/test_body_nested_models/test_tutorial008.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_body_updates/test_tutorial002.py b/tests/test_tutorial/test_body_updates/test_tutorial002.py index 609a10288..3a8035dc8 100644 --- a/tests/test_tutorial/test_body_updates/test_tutorial002.py +++ b/tests/test_tutorial/test_body_updates/test_tutorial002.py @@ -5,13 +5,14 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 - # Remove when deprecating Pydantic v1 -pytestmark = pytest.mark.filterwarnings( - "ignore:The `copy` method is deprecated; use `model_copy` instead.:DeprecationWarning", - "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning", -) +pytestmark = [ + pytest.mark.filterwarnings( + "ignore:The `copy` method is deprecated; use `model_copy` instead.:DeprecationWarning", + "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning", + ), + needs_pydanticv2, +] @pytest.fixture( diff --git a/tests/test_tutorial/test_dependencies/test_tutorial001_tutorial001_02.py b/tests/test_tutorial/test_dependencies/test_tutorial001_tutorial001_02.py index aae13b011..f343b52b7 100644 --- a/tests/test_tutorial/test_dependencies/test_tutorial001_tutorial001_02.py +++ b/tests/test_tutorial/test_dependencies/test_tutorial001_tutorial001_02.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_dependencies/test_tutorial002_tutorial003_tutorial004.py b/tests/test_tutorial/test_dependencies/test_tutorial002_tutorial003_tutorial004.py index e928f026e..97c81078a 100644 --- a/tests/test_tutorial/test_dependencies/test_tutorial002_tutorial003_tutorial004.py +++ b/tests/test_tutorial/test_dependencies/test_tutorial002_tutorial003_tutorial004.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_dependencies/test_tutorial005.py b/tests/test_tutorial/test_dependencies/test_tutorial005.py index 1aeab44e6..0d614d6be 100644 --- a/tests/test_tutorial/test_dependencies/test_tutorial005.py +++ b/tests/test_tutorial/test_dependencies/test_tutorial005.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_dependencies/test_tutorial011.py b/tests/test_tutorial/test_dependencies/test_tutorial011.py index 03bf86ace..05544afbc 100644 --- a/tests/test_tutorial/test_dependencies/test_tutorial011.py +++ b/tests/test_tutorial/test_dependencies/test_tutorial011.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_encoder/test_tutorial001.py b/tests/test_tutorial/test_encoder/test_tutorial001.py index 27be0c32a..78f90b265 100644 --- a/tests/test_tutorial/test_encoder/test_tutorial001.py +++ b/tests/test_tutorial/test_encoder/test_tutorial001.py @@ -6,7 +6,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_extra_models/test_tutorial001_tutorial002.py b/tests/test_tutorial/test_extra_models/test_tutorial001_tutorial002.py index 019bc5b8e..baa126d93 100644 --- a/tests/test_tutorial/test_extra_models/test_tutorial001_tutorial002.py +++ b/tests/test_tutorial/test_extra_models/test_tutorial001_tutorial002.py @@ -6,12 +6,13 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 - # Remove when deprecating Pydantic v1 -pytestmark = pytest.mark.filterwarnings( - "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning", -) +pytestmark = [ + pytest.mark.filterwarnings( + "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning", + ), + needs_pydanticv2, +] @pytest.fixture( diff --git a/tests/test_tutorial/test_path_operation_configurations/test_tutorial001.py b/tests/test_tutorial/test_path_operation_configurations/test_tutorial001.py index 31d0a3d0e..8f1890ed6 100644 --- a/tests/test_tutorial/test_path_operation_configurations/test_tutorial001.py +++ b/tests/test_tutorial/test_path_operation_configurations/test_tutorial001.py @@ -6,7 +6,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py b/tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py index c16d8f655..478662b03 100644 --- a/tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py +++ b/tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py @@ -6,7 +6,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py b/tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py index 91c225345..6479f640c 100644 --- a/tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py +++ b/tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py @@ -7,7 +7,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 DESCRIPTIONS = { diff --git a/tests/test_tutorial/test_path_params/test_tutorial002.py b/tests/test_tutorial/test_path_params/test_tutorial002.py index 0bfc9f807..119cbdf99 100644 --- a/tests/test_tutorial/test_path_params/test_tutorial002.py +++ b/tests/test_tutorial/test_path_params/test_tutorial002.py @@ -2,8 +2,12 @@ from fastapi.testclient import TestClient from docs_src.path_params.tutorial002_py39 import app +from ...utils import needs_pydanticv2 + client = TestClient(app) +pytestmark = needs_pydanticv2 + def test_get_items(): response = client.get("/items/1") diff --git a/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial001.py b/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial001.py index cb1549026..11ea557d7 100644 --- a/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial001.py +++ b/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial001.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial002_tutorial003.py b/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial002_tutorial003.py index 33a516814..c5691edbb 100644 --- a/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial002_tutorial003.py +++ b/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial002_tutorial003.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial004.py b/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial004.py index 091157320..d73f44454 100644 --- a/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial004.py +++ b/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial004.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial005.py b/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial005.py index 90657bb05..44a1e6e46 100644 --- a/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial005.py +++ b/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial005.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial006.py b/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial006.py index 561c4d86c..f0f26123c 100644 --- a/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial006.py +++ b/tests/test_tutorial/test_path_params_numeric_validations/test_tutorial006.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params/test_tutorial001.py b/tests/test_tutorial/test_query_params/test_tutorial001.py index a459d1915..1f88ab262 100644 --- a/tests/test_tutorial/test_query_params/test_tutorial001.py +++ b/tests/test_tutorial/test_query_params/test_tutorial001.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params/test_tutorial002.py b/tests/test_tutorial/test_query_params/test_tutorial002.py index bd3d07b98..55f4b4f21 100644 --- a/tests/test_tutorial/test_query_params/test_tutorial002.py +++ b/tests/test_tutorial/test_query_params/test_tutorial002.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params/test_tutorial003.py b/tests/test_tutorial/test_query_params/test_tutorial003.py index 3c6d157dc..6c4e4608d 100644 --- a/tests/test_tutorial/test_query_params/test_tutorial003.py +++ b/tests/test_tutorial/test_query_params/test_tutorial003.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params/test_tutorial004.py b/tests/test_tutorial/test_query_params/test_tutorial004.py index 04537d684..d3192a2f0 100644 --- a/tests/test_tutorial/test_query_params/test_tutorial004.py +++ b/tests/test_tutorial/test_query_params/test_tutorial004.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial001.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial001.py index 3e059ea51..efe6659ec 100644 --- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial001.py +++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial001.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial002.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial002.py index 090f6010c..84e28bff2 100644 --- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial002.py +++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial002.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial003.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial003.py index 713186329..f441c1365 100644 --- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial003.py +++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial003.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial004.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial004.py index ef85acb0a..9c1c26f2a 100644 --- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial004.py +++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial004.py @@ -5,11 +5,12 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 - -pytestmark = pytest.mark.filterwarnings( - "ignore:`regex` has been deprecated, please use `pattern` instead:DeprecationWarning" -) +pytestmark = [ + pytest.mark.filterwarnings( + "ignore:`regex` has been deprecated, please use `pattern` instead:DeprecationWarning" + ), + needs_pydanticv2, +] @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial005.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial005.py index 31f036362..018c22b48 100644 --- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial005.py +++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial005.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial006.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial006.py index 1314f3689..a2dbd6cbd 100644 --- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial006.py +++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial006.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial006c.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial006c.py index f377ba17d..e695a1f96 100644 --- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial006c.py +++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial006c.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial007.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial007.py index 3b30c520c..3a774d497 100644 --- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial007.py +++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial007.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial008.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial008.py index 73ade9ac7..aa5a72e58 100644 --- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial008.py +++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial008.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial009.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial009.py index c0fb019cb..b13f2309e 100644 --- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial009.py +++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial009.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_response_directly/test_tutorial002.py b/tests/test_tutorial/test_response_directly/test_tutorial002.py index aac038ec0..c446ff4d5 100644 --- a/tests/test_tutorial/test_response_directly/test_tutorial002.py +++ b/tests/test_tutorial/test_response_directly/test_tutorial002.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_response_model/test_tutorial001_tutorial001_01.py b/tests/test_tutorial/test_response_model/test_tutorial001_tutorial001_01.py index 72de40650..c841373f2 100644 --- a/tests/test_tutorial/test_response_model/test_tutorial001_tutorial001_01.py +++ b/tests/test_tutorial/test_response_model/test_tutorial001_tutorial001_01.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_response_model/test_tutorial002.py b/tests/test_tutorial/test_response_model/test_tutorial002.py index f4813705f..66c7c43e7 100644 --- a/tests/test_tutorial/test_response_model/test_tutorial002.py +++ b/tests/test_tutorial/test_response_model/test_tutorial002.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_schema_extra_example/test_tutorial002.py b/tests/test_tutorial/test_schema_extra_example/test_tutorial002.py index ad9ec85a7..bb71eace6 100644 --- a/tests/test_tutorial/test_schema_extra_example/test_tutorial002.py +++ b/tests/test_tutorial/test_schema_extra_example/test_tutorial002.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_schema_extra_example/test_tutorial003.py b/tests/test_tutorial/test_schema_extra_example/test_tutorial003.py index 44bc4848c..9eadcfd11 100644 --- a/tests/test_tutorial/test_schema_extra_example/test_tutorial003.py +++ b/tests/test_tutorial/test_schema_extra_example/test_tutorial003.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_security/test_tutorial002.py b/tests/test_tutorial/test_security/test_tutorial002.py index ee2298c8e..b5ad28eaa 100644 --- a/tests/test_tutorial/test_security/test_tutorial002.py +++ b/tests/test_tutorial/test_security/test_tutorial002.py @@ -5,7 +5,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_security/test_tutorial004.py b/tests/test_tutorial/test_security/test_tutorial004.py index 2ceb1ea23..df0479392 100644 --- a/tests/test_tutorial/test_security/test_tutorial004.py +++ b/tests/test_tutorial/test_security/test_tutorial004.py @@ -7,7 +7,7 @@ from fastapi.testclient import TestClient from ...utils import needs_py310, needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture( diff --git a/tests/test_tutorial/test_settings/test_app01.py b/tests/test_tutorial/test_settings/test_app01.py index dd5b22765..8953e2274 100644 --- a/tests/test_tutorial/test_settings/test_app01.py +++ b/tests/test_tutorial/test_settings/test_app01.py @@ -9,7 +9,7 @@ from pytest import MonkeyPatch from ...utils import needs_pydanticv2 -skip_for_pydantic_v1 = needs_pydanticv2 +pytestmark = needs_pydanticv2 @pytest.fixture(