Browse Source

Fix applying `needs_pydanticv2` to modules

pull/14569/head
Yurii Motov 7 months ago
parent
commit
8c8addfb59
  1. 11
      tests/test_tutorial/test_body/test_tutorial002.py
  2. 11
      tests/test_tutorial/test_body/test_tutorial003.py
  3. 11
      tests/test_tutorial/test_body/test_tutorial004.py
  4. 2
      tests/test_tutorial/test_body_multiple_params/test_tutorial002.py
  5. 2
      tests/test_tutorial/test_body_multiple_params/test_tutorial004.py
  6. 2
      tests/test_tutorial/test_body_multiple_params/test_tutorial005.py
  7. 2
      tests/test_tutorial/test_body_nested_models/test_tutorial001_tutorial002_tutorial003.py
  8. 2
      tests/test_tutorial/test_body_nested_models/test_tutorial004.py
  9. 2
      tests/test_tutorial/test_body_nested_models/test_tutorial005.py
  10. 2
      tests/test_tutorial/test_body_nested_models/test_tutorial006.py
  11. 2
      tests/test_tutorial/test_body_nested_models/test_tutorial007.py
  12. 2
      tests/test_tutorial/test_body_nested_models/test_tutorial008.py
  13. 13
      tests/test_tutorial/test_body_updates/test_tutorial002.py
  14. 2
      tests/test_tutorial/test_dependencies/test_tutorial001_tutorial001_02.py
  15. 2
      tests/test_tutorial/test_dependencies/test_tutorial002_tutorial003_tutorial004.py
  16. 2
      tests/test_tutorial/test_dependencies/test_tutorial005.py
  17. 2
      tests/test_tutorial/test_dependencies/test_tutorial011.py
  18. 2
      tests/test_tutorial/test_encoder/test_tutorial001.py
  19. 11
      tests/test_tutorial/test_extra_models/test_tutorial001_tutorial002.py
  20. 2
      tests/test_tutorial/test_path_operation_configurations/test_tutorial001.py
  21. 2
      tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py
  22. 2
      tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py
  23. 4
      tests/test_tutorial/test_path_params/test_tutorial002.py
  24. 2
      tests/test_tutorial/test_path_params_numeric_validations/test_tutorial001.py
  25. 2
      tests/test_tutorial/test_path_params_numeric_validations/test_tutorial002_tutorial003.py
  26. 2
      tests/test_tutorial/test_path_params_numeric_validations/test_tutorial004.py
  27. 2
      tests/test_tutorial/test_path_params_numeric_validations/test_tutorial005.py
  28. 2
      tests/test_tutorial/test_path_params_numeric_validations/test_tutorial006.py
  29. 2
      tests/test_tutorial/test_query_params/test_tutorial001.py
  30. 2
      tests/test_tutorial/test_query_params/test_tutorial002.py
  31. 2
      tests/test_tutorial/test_query_params/test_tutorial003.py
  32. 2
      tests/test_tutorial/test_query_params/test_tutorial004.py
  33. 2
      tests/test_tutorial/test_query_params_str_validations/test_tutorial001.py
  34. 2
      tests/test_tutorial/test_query_params_str_validations/test_tutorial002.py
  35. 2
      tests/test_tutorial/test_query_params_str_validations/test_tutorial003.py
  36. 11
      tests/test_tutorial/test_query_params_str_validations/test_tutorial004.py
  37. 2
      tests/test_tutorial/test_query_params_str_validations/test_tutorial005.py
  38. 2
      tests/test_tutorial/test_query_params_str_validations/test_tutorial006.py
  39. 2
      tests/test_tutorial/test_query_params_str_validations/test_tutorial006c.py
  40. 2
      tests/test_tutorial/test_query_params_str_validations/test_tutorial007.py
  41. 2
      tests/test_tutorial/test_query_params_str_validations/test_tutorial008.py
  42. 2
      tests/test_tutorial/test_query_params_str_validations/test_tutorial009.py
  43. 2
      tests/test_tutorial/test_response_directly/test_tutorial002.py
  44. 2
      tests/test_tutorial/test_response_model/test_tutorial001_tutorial001_01.py
  45. 2
      tests/test_tutorial/test_response_model/test_tutorial002.py
  46. 2
      tests/test_tutorial/test_schema_extra_example/test_tutorial002.py
  47. 2
      tests/test_tutorial/test_schema_extra_example/test_tutorial003.py
  48. 2
      tests/test_tutorial/test_security/test_tutorial002.py
  49. 2
      tests/test_tutorial/test_security/test_tutorial004.py
  50. 2
      tests/test_tutorial/test_settings/test_app01.py

11
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(

11
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(

11
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(

2
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(

2
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(

2
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(

2
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": {}}

2
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(

2
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(

2
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(

2
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(

2
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(

13
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(

2
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(

2
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(

2
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(

2
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(

2
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(

11
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(

2
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(

2
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(

2
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 = {

4
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")

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

11
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

2
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(

Loading…
Cancel
Save