From aae90fd3f8a699f0e2080a4f0ada820ed1b6bdf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 26 Dec 2025 10:55:19 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Update=20tests,=20remove=20needs=5F?= =?UTF-8?q?pydanticv2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_tutorial/test_body/test_tutorial002.py | 10 +--------- tests/test_tutorial/test_body/test_tutorial003.py | 10 +--------- tests/test_tutorial/test_body/test_tutorial004.py | 10 +--------- .../test_body_multiple_params/test_tutorial002.py | 4 +--- .../test_body_multiple_params/test_tutorial004.py | 4 +--- .../test_body_multiple_params/test_tutorial005.py | 4 +--- .../test_tutorial001_tutorial002_tutorial003.py | 4 +--- .../test_body_nested_models/test_tutorial004.py | 4 +--- .../test_body_nested_models/test_tutorial005.py | 4 +--- .../test_body_nested_models/test_tutorial006.py | 4 +--- .../test_body_nested_models/test_tutorial007.py | 4 +--- .../test_body_nested_models/test_tutorial008.py | 4 ---- .../test_body_updates/test_tutorial002.py | 11 +---------- .../test_tutorial001_tutorial001_02.py | 4 +--- .../test_tutorial002_tutorial003_tutorial004.py | 4 +--- .../test_dependencies/test_tutorial005.py | 4 +--- .../test_dependencies/test_tutorial011.py | 4 ---- tests/test_tutorial/test_encoder/test_tutorial001.py | 4 +--- .../test_extra_models/test_tutorial001_tutorial002.py | 10 +--------- .../test_tutorial001.py | 4 +--- .../test_tutorial002.py | 4 +--- .../test_tutorial003_tutorial004.py | 5 +---- .../test_path_params/test_tutorial002.py | 4 ---- .../test_tutorial001.py | 4 +--- .../test_tutorial002_tutorial003.py | 4 ---- .../test_tutorial004.py | 4 ---- .../test_tutorial005.py | 4 ---- .../test_tutorial006.py | 4 ---- .../test_query_params/test_tutorial001.py | 4 ---- .../test_query_params/test_tutorial002.py | 4 +--- .../test_query_params/test_tutorial003.py | 4 +--- .../test_query_params/test_tutorial004.py | 4 +--- .../test_tutorial001.py | 4 +--- .../test_tutorial002.py | 4 +--- .../test_tutorial003.py | 4 +--- .../test_tutorial004.py | 9 +-------- .../test_tutorial005.py | 4 ---- .../test_tutorial006.py | 4 ---- .../test_tutorial006c.py | 4 +--- .../test_tutorial007.py | 4 +--- .../test_tutorial008.py | 4 +--- .../test_tutorial009.py | 4 +--- .../test_response_directly/test_tutorial002.py | 4 ---- .../test_tutorial001_tutorial001_01.py | 4 +--- .../test_response_model/test_tutorial002.py | 4 +--- .../test_schema_extra_example/test_tutorial002.py | 4 +--- .../test_schema_extra_example/test_tutorial003.py | 5 +---- tests/test_tutorial/test_security/test_tutorial002.py | 4 +--- tests/test_tutorial/test_security/test_tutorial004.py | 4 +--- tests/test_tutorial/test_settings/test_app01.py | 4 ---- 50 files changed, 38 insertions(+), 200 deletions(-) diff --git a/tests/test_tutorial/test_body/test_tutorial002.py b/tests/test_tutorial/test_body/test_tutorial002.py index fe68f7553..b6d51d523 100644 --- a/tests/test_tutorial/test_body/test_tutorial002.py +++ b/tests/test_tutorial/test_body/test_tutorial002.py @@ -4,15 +4,7 @@ from typing import Union import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -# TODO: Remove when deprecating Pydantic v1 -pytestmark = [ - pytest.mark.filterwarnings( - "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning" - ), - needs_pydanticv2, -] +from ...utils import needs_py310 @pytest.fixture( diff --git a/tests/test_tutorial/test_body/test_tutorial003.py b/tests/test_tutorial/test_body/test_tutorial003.py index 3c90ccbf6..227a125e7 100644 --- a/tests/test_tutorial/test_body/test_tutorial003.py +++ b/tests/test_tutorial/test_body/test_tutorial003.py @@ -3,15 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -# TODO: Remove when deprecating Pydantic v1 -pytestmark = [ - pytest.mark.filterwarnings( - "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning" - ), - needs_pydanticv2, -] +from ...utils import needs_py310 @pytest.fixture( diff --git a/tests/test_tutorial/test_body/test_tutorial004.py b/tests/test_tutorial/test_body/test_tutorial004.py index 2cbcd864a..10212843e 100644 --- a/tests/test_tutorial/test_body/test_tutorial004.py +++ b/tests/test_tutorial/test_body/test_tutorial004.py @@ -3,15 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -# TODO: Remove when deprecating Pydantic v1 -pytestmark = [ - pytest.mark.filterwarnings( - "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning" - ), - needs_pydanticv2, -] +from ...utils import needs_py310 @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 476f7916d..e98d5860f 100644 --- a/tests/test_tutorial/test_body_multiple_params/test_tutorial002.py +++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial002.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 4a0767d3a..979c054cd 100644 --- a/tests/test_tutorial/test_body_multiple_params/test_tutorial004.py +++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial004.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 8f2cc9920..d47aa1b4f 100644 --- a/tests/test_tutorial/test_body_multiple_params/test_tutorial005.py +++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial005.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 8d9f5b917..d452929c3 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 @@ -4,9 +4,7 @@ import pytest from dirty_equals import IsList from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 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 da80333ab..ff9596943 100644 --- a/tests/test_tutorial/test_body_nested_models/test_tutorial004.py +++ b/tests/test_tutorial/test_body_nested_models/test_tutorial004.py @@ -4,9 +4,7 @@ import pytest from dirty_equals import IsList from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 9de2df69c..9a07a904e 100644 --- a/tests/test_tutorial/test_body_nested_models/test_tutorial005.py +++ b/tests/test_tutorial/test_body_nested_models/test_tutorial005.py @@ -4,9 +4,7 @@ import pytest from dirty_equals import IsList from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 65d5e7c05..088177cb9 100644 --- a/tests/test_tutorial/test_body_nested_models/test_tutorial006.py +++ b/tests/test_tutorial/test_body_nested_models/test_tutorial006.py @@ -4,9 +4,7 @@ import pytest from dirty_equals import IsList from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 717feaee0..a30281950 100644 --- a/tests/test_tutorial/test_body_nested_models/test_tutorial007.py +++ b/tests/test_tutorial/test_body_nested_models/test_tutorial007.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 ca6b78afe..32eb8ee75 100644 --- a/tests/test_tutorial/test_body_nested_models/test_tutorial008.py +++ b/tests/test_tutorial/test_body_nested_models/test_tutorial008.py @@ -3,10 +3,6 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_pydanticv2 - -pytestmark = needs_pydanticv2 - @pytest.fixture( name="client", diff --git a/tests/test_tutorial/test_body_updates/test_tutorial002.py b/tests/test_tutorial/test_body_updates/test_tutorial002.py index d5e681b28..466e6af8f 100644 --- a/tests/test_tutorial/test_body_updates/test_tutorial002.py +++ b/tests/test_tutorial/test_body_updates/test_tutorial002.py @@ -3,16 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -# TODO: 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", - ), - needs_pydanticv2, -] +from ...utils import needs_py310 @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 f343b52b7..50d7c4108 100644 --- a/tests/test_tutorial/test_dependencies/test_tutorial001_tutorial001_02.py +++ b/tests/test_tutorial/test_dependencies/test_tutorial001_tutorial001_02.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 97c81078a..f09d6f268 100644 --- a/tests/test_tutorial/test_dependencies/test_tutorial002_tutorial003_tutorial004.py +++ b/tests/test_tutorial/test_dependencies/test_tutorial002_tutorial003_tutorial004.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @pytest.fixture( diff --git a/tests/test_tutorial/test_dependencies/test_tutorial005.py b/tests/test_tutorial/test_dependencies/test_tutorial005.py index 0d614d6be..a914936ba 100644 --- a/tests/test_tutorial/test_dependencies/test_tutorial005.py +++ b/tests/test_tutorial/test_dependencies/test_tutorial005.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @pytest.fixture( diff --git a/tests/test_tutorial/test_dependencies/test_tutorial011.py b/tests/test_tutorial/test_dependencies/test_tutorial011.py index 05544afbc..4868254c0 100644 --- a/tests/test_tutorial/test_dependencies/test_tutorial011.py +++ b/tests/test_tutorial/test_dependencies/test_tutorial011.py @@ -3,10 +3,6 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_pydanticv2 - -pytestmark = needs_pydanticv2 - @pytest.fixture( name="client", diff --git a/tests/test_tutorial/test_encoder/test_tutorial001.py b/tests/test_tutorial/test_encoder/test_tutorial001.py index 78f90b265..5c8ee054d 100644 --- a/tests/test_tutorial/test_encoder/test_tutorial001.py +++ b/tests/test_tutorial/test_encoder/test_tutorial001.py @@ -4,9 +4,7 @@ from types import ModuleType import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 a0cae89dc..3f2f508a1 100644 --- a/tests/test_tutorial/test_extra_models/test_tutorial001_tutorial002.py +++ b/tests/test_tutorial/test_extra_models/test_tutorial001_tutorial002.py @@ -4,15 +4,7 @@ import pytest from dirty_equals import IsList from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -# TODO: Remove when deprecating Pydantic v1 -pytestmark = [ - pytest.mark.filterwarnings( - "ignore:The `dict` method is deprecated; use `model_dump` instead.:DeprecationWarning", - ), - needs_pydanticv2, -] +from ...utils import needs_py310 @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 8f1890ed6..085d1f5e1 100644 --- a/tests/test_tutorial/test_path_operation_configurations/test_tutorial001.py +++ b/tests/test_tutorial/test_path_operation_configurations/test_tutorial001.py @@ -4,9 +4,7 @@ import pytest from dirty_equals import IsList from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 478662b03..c7414d756 100644 --- a/tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py +++ b/tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py @@ -4,9 +4,7 @@ import pytest from dirty_equals import IsList from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 6479f640c..791db2462 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 @@ -5,10 +5,7 @@ import pytest from dirty_equals import IsList from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 - +from ...utils import needs_py310 DESCRIPTIONS = { "tutorial003": "Create an item with all the information, name, description, price, tax and a set of unique tags", diff --git a/tests/test_tutorial/test_path_params/test_tutorial002.py b/tests/test_tutorial/test_path_params/test_tutorial002.py index 119cbdf99..0bfc9f807 100644 --- a/tests/test_tutorial/test_path_params/test_tutorial002.py +++ b/tests/test_tutorial/test_path_params/test_tutorial002.py @@ -2,12 +2,8 @@ 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 11ea557d7..f1e304103 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 @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 c5691edbb..467c915dc 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 @@ -3,10 +3,6 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_pydanticv2 - -pytestmark = needs_pydanticv2 - @pytest.fixture( name="client", 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 d73f44454..d3593c984 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 @@ -3,10 +3,6 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_pydanticv2 - -pytestmark = needs_pydanticv2 - @pytest.fixture( name="client", 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 44a1e6e46..296192593 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 @@ -3,10 +3,6 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_pydanticv2 - -pytestmark = needs_pydanticv2 - @pytest.fixture( name="client", 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 f0f26123c..9dc7d7aac 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 @@ -3,10 +3,6 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_pydanticv2 - -pytestmark = needs_pydanticv2 - @pytest.fixture( name="client", diff --git a/tests/test_tutorial/test_query_params/test_tutorial001.py b/tests/test_tutorial/test_query_params/test_tutorial001.py index 1f88ab262..4c92b57b8 100644 --- a/tests/test_tutorial/test_query_params/test_tutorial001.py +++ b/tests/test_tutorial/test_query_params/test_tutorial001.py @@ -3,10 +3,6 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_pydanticv2 - -pytestmark = needs_pydanticv2 - @pytest.fixture( name="client", diff --git a/tests/test_tutorial/test_query_params/test_tutorial002.py b/tests/test_tutorial/test_query_params/test_tutorial002.py index 55f4b4f21..ae3ee7613 100644 --- a/tests/test_tutorial/test_query_params/test_tutorial002.py +++ b/tests/test_tutorial/test_query_params/test_tutorial002.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 6c4e4608d..c0b7e3b13 100644 --- a/tests/test_tutorial/test_query_params/test_tutorial003.py +++ b/tests/test_tutorial/test_query_params/test_tutorial003.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 d3192a2f0..9be18b74d 100644 --- a/tests/test_tutorial/test_query_params/test_tutorial004.py +++ b/tests/test_tutorial/test_query_params/test_tutorial004.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 efe6659ec..f1af7e08c 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 @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 84e28bff2..62018b80b 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 @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 f441c1365..a4ad7a63b 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 @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 9c1c26f2a..ca1bd1af6 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 @@ -3,14 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = [ - pytest.mark.filterwarnings( - "ignore:`regex` has been deprecated, please use `pattern` instead:DeprecationWarning" - ), - needs_pydanticv2, -] +from ...utils import needs_py310 @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 018c22b48..52462fe33 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 @@ -3,10 +3,6 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_pydanticv2 - -pytestmark = needs_pydanticv2 - @pytest.fixture( name="client", 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 a2dbd6cbd..640cedce1 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 @@ -3,10 +3,6 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_pydanticv2 - -pytestmark = needs_pydanticv2 - @pytest.fixture( name="client", 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 e695a1f96..f287b5dcd 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 @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 3a774d497..b17bc2771 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 @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 aa5a72e58..c63111574 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 @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 b13f2309e..7e9d69d41 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 @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 c446ff4d5..ef8457572 100644 --- a/tests/test_tutorial/test_response_directly/test_tutorial002.py +++ b/tests/test_tutorial/test_response_directly/test_tutorial002.py @@ -3,10 +3,6 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_pydanticv2 - -pytestmark = needs_pydanticv2 - @pytest.fixture( name="client", 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 c841373f2..10692f990 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 @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 66c7c43e7..216d4c420 100644 --- a/tests/test_tutorial/test_response_model/test_tutorial002.py +++ b/tests/test_tutorial/test_response_model/test_tutorial002.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 bb71eace6..4f5240860 100644 --- a/tests/test_tutorial/test_schema_extra_example/test_tutorial002.py +++ b/tests/test_tutorial/test_schema_extra_example/test_tutorial002.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @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 9eadcfd11..3529a9bf0 100644 --- a/tests/test_tutorial/test_schema_extra_example/test_tutorial003.py +++ b/tests/test_tutorial/test_schema_extra_example/test_tutorial003.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @pytest.fixture( @@ -24,7 +22,6 @@ def get_client(request: pytest.FixtureRequest): return client -@needs_pydanticv2 def test_post_body_example(client: TestClient): response = client.put( "/items/5", diff --git a/tests/test_tutorial/test_security/test_tutorial002.py b/tests/test_tutorial/test_security/test_tutorial002.py index b5ad28eaa..85c076b1d 100644 --- a/tests/test_tutorial/test_security/test_tutorial002.py +++ b/tests/test_tutorial/test_security/test_tutorial002.py @@ -3,9 +3,7 @@ import importlib import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @pytest.fixture( diff --git a/tests/test_tutorial/test_security/test_tutorial004.py b/tests/test_tutorial/test_security/test_tutorial004.py index df0479392..b5e3d39ef 100644 --- a/tests/test_tutorial/test_security/test_tutorial004.py +++ b/tests/test_tutorial/test_security/test_tutorial004.py @@ -5,9 +5,7 @@ from unittest.mock import patch import pytest from fastapi.testclient import TestClient -from ...utils import needs_py310, needs_pydanticv2 - -pytestmark = needs_pydanticv2 +from ...utils import needs_py310 @pytest.fixture( diff --git a/tests/test_tutorial/test_settings/test_app01.py b/tests/test_tutorial/test_settings/test_app01.py index 8953e2274..0c5e440f1 100644 --- a/tests/test_tutorial/test_settings/test_app01.py +++ b/tests/test_tutorial/test_settings/test_app01.py @@ -7,10 +7,6 @@ from fastapi.testclient import TestClient from pydantic import ValidationError from pytest import MonkeyPatch -from ...utils import needs_pydanticv2 - -pytestmark = needs_pydanticv2 - @pytest.fixture( name="mod_name",