]> git.ipfire.org Git - thirdparty/fastapi/sqlmodel.git/commitdiff
✅ Update tests, remove conditionals for Pydantic v1 (#1702)
authorSebastián Ramírez <tiangolo@gmail.com>
Sun, 28 Dec 2025 13:08:19 +0000 (05:08 -0800)
committerGitHub <noreply@github.com>
Sun, 28 Dec 2025 13:08:19 +0000 (13:08 +0000)
12 files changed:
tests/test_tutorial/test_fastapi/test_delete/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_limit_and_offset/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_multiple_models/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_multiple_models/test_tutorial002.py
tests/test_tutorial/test_fastapi/test_read_one/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_relationships/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_response_model/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_session_with_dependency/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_simple_hero_api/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_teams/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py

index ffbf7587f162370582b2ac1a97c05a9d9fd63663..a766b37d47a9273085af8505969756b57c7b1ea9 100644 (file)
@@ -2,7 +2,6 @@ import importlib
 from types import ModuleType
 
 import pytest
-from dirty_equals import IsDict
 from fastapi.testclient import TestClient
 from sqlmodel import create_engine
 from sqlmodel.pool import StaticPool
@@ -300,16 +299,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "HeroPublic": {
@@ -319,16 +312,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
@@ -336,36 +323,18 @@ def test_tutorial(module: ModuleType):
                         "title": "HeroUpdate",
                         "type": "object",
                         "properties": {
-                            "name": IsDict(
-                                {
-                                    "title": "Name",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Name", "type": "string"}
-                            ),
-                            "secret_name": IsDict(
-                                {
-                                    "title": "Secret Name",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Secret Name", "type": "string"}
-                            ),
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "name": {
+                                "title": "Name",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
+                            "secret_name": {
+                                "title": "Secret Name",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "ValidationError": {
index cbc722c5c2ee2c50a903154ae56bdc096c2c5960..241241a42257e5afa4f9a63de3929c8d7b49d436 100644 (file)
@@ -2,7 +2,6 @@ import importlib
 from types import ModuleType
 
 import pytest
-from dirty_equals import IsDict
 from fastapi.testclient import TestClient
 from sqlmodel import create_engine
 from sqlmodel.pool import StaticPool
@@ -235,16 +234,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "HeroPublic": {
@@ -254,16 +247,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
index d70dce32e6841353d8de303bf5344a232dcd4209..1690ba26efe24a5f452e9af619466e7245640f12 100644 (file)
@@ -2,7 +2,6 @@ import importlib
 from types import ModuleType
 
 import pytest
-from dirty_equals import IsDict
 from fastapi.testclient import TestClient
 from sqlalchemy import inspect
 from sqlalchemy.engine.reflection import Inspector
@@ -159,16 +158,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "HeroPublic": {
@@ -179,16 +172,10 @@ def test_tutorial(module: ModuleType):
                             "id": {"title": "Id", "type": "integer"},
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "ValidationError": {
index 8d7c8064e7208a041122f030e1e338af56206fc2..b17fc20ffaea588e345ef1f1b8474cb847304ffd 100644 (file)
@@ -2,7 +2,6 @@ import importlib
 from types import ModuleType
 
 import pytest
-from dirty_equals import IsDict
 from fastapi.testclient import TestClient
 from sqlalchemy import inspect
 from sqlalchemy.engine.reflection import Inspector
@@ -159,16 +158,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "HeroPublic": {
@@ -178,16 +171,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
index 7ebbecd8de4af93741edeaa89e4fcf0bc6b53a31..420da4a379bb8f6df4e5a500250b54ddaf4ac086 100644 (file)
@@ -2,7 +2,6 @@ import importlib
 from types import ModuleType
 
 import pytest
-from dirty_equals import IsDict
 from fastapi.testclient import TestClient
 from sqlmodel import create_engine
 from sqlmodel.pool import StaticPool
@@ -178,16 +177,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "HeroPublic": {
@@ -197,16 +190,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
index cf24466c138d9a0daac845e3e3200cbccdca4d50..07be8c308988a347407ccaec6ef1528224b9e6f2 100644 (file)
@@ -2,7 +2,6 @@ import importlib
 from types import ModuleType
 
 import pytest
-from dirty_equals import IsDict
 from fastapi.testclient import TestClient
 from sqlmodel import create_engine
 from sqlmodel.pool import StaticPool
@@ -549,26 +548,14 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
-                            "team_id": IsDict(
-                                {
-                                    "title": "Team Id",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Team Id", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
+                            "team_id": {
+                                "title": "Team Id",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "HeroPublic": {
@@ -578,26 +565,14 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
-                            "team_id": IsDict(
-                                {
-                                    "title": "Team Id",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Team Id", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
+                            "team_id": {
+                                "title": "Team Id",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
@@ -608,85 +583,43 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
-                            "team_id": IsDict(
-                                {
-                                    "title": "Team Id",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Team Id", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
+                            "team_id": {
+                                "title": "Team Id",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                             "id": {"title": "Id", "type": "integer"},
-                            "team": IsDict(
-                                {
-                                    "anyOf": [
-                                        {"$ref": "#/components/schemas/TeamPublic"},
-                                        {"type": "null"},
-                                    ]
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"$ref": "#/components/schemas/TeamPublic"}
-                            ),
+                            "team": {
+                                "anyOf": [
+                                    {"$ref": "#/components/schemas/TeamPublic"},
+                                    {"type": "null"},
+                                ]
+                            },
                         },
                     },
                     "HeroUpdate": {
                         "title": "HeroUpdate",
                         "type": "object",
                         "properties": {
-                            "name": IsDict(
-                                {
-                                    "title": "Name",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Name", "type": "string"}
-                            ),
-                            "secret_name": IsDict(
-                                {
-                                    "title": "Secret Name",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Secret Name", "type": "string"}
-                            ),
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
-                            "team_id": IsDict(
-                                {
-                                    "title": "Team Id",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Team Id", "type": "integer"}
-                            ),
+                            "name": {
+                                "title": "Name",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
+                            "secret_name": {
+                                "title": "Secret Name",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
+                            "team_id": {
+                                "title": "Team Id",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "TeamCreate": {
@@ -728,36 +661,18 @@ def test_tutorial(module: ModuleType):
                         "title": "TeamUpdate",
                         "type": "object",
                         "properties": {
-                            "id": IsDict(
-                                {
-                                    "title": "Id",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Id", "type": "integer"}
-                            ),
-                            "name": IsDict(
-                                {
-                                    "title": "Name",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Name", "type": "string"}
-                            ),
-                            "headquarters": IsDict(
-                                {
-                                    "title": "Headquarters",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Headquarters", "type": "string"}
-                            ),
+                            "id": {
+                                "title": "Id",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
+                            "name": {
+                                "title": "Name",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
+                            "headquarters": {
+                                "title": "Headquarters",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
                         },
                     },
                     "ValidationError": {
index 1ad004e93925f11b4595ed544b0422ed9fedc042..2951268d99a6d9f53f79605785156e5f763b273b 100644 (file)
@@ -2,7 +2,6 @@ import importlib
 from types import ModuleType
 
 import pytest
-from dirty_equals import IsDict
 from fastapi.testclient import TestClient
 from sqlmodel import create_engine
 from sqlmodel.pool import StaticPool
@@ -131,28 +130,16 @@ def test_tutorial(module: ModuleType):
                         "required": ["name", "secret_name"],
                         "type": "object",
                         "properties": {
-                            "id": IsDict(
-                                {
-                                    "title": "Id",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Id", "type": "integer"}
-                            ),
+                            "id": {
+                                "title": "Id",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "ValidationError": {
index 6e441cccbc1dac2166eacb86660a43b38258707b..6528f853335d3c281ef99d29e8479a0f5553538d 100644 (file)
@@ -2,7 +2,6 @@ import importlib
 from types import ModuleType
 
 import pytest
-from dirty_equals import IsDict
 from fastapi.testclient import TestClient
 from sqlmodel import create_engine
 from sqlmodel.pool import StaticPool
@@ -302,16 +301,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "HeroPublic": {
@@ -321,16 +314,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
@@ -338,36 +325,18 @@ def test_tutorial(module: ModuleType):
                         "title": "HeroUpdate",
                         "type": "object",
                         "properties": {
-                            "name": IsDict(
-                                {
-                                    "title": "Name",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Name", "type": "string"}
-                            ),
-                            "secret_name": IsDict(
-                                {
-                                    "title": "Secret Name",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Secret Name", "type": "string"}
-                            ),
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "name": {
+                                "title": "Name",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
+                            "secret_name": {
+                                "title": "Secret Name",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "ValidationError": {
index b803cee28a61ad90084581851d78231627283da4..b6f88b136e3e8542f01af6fce57993fec366e6f6 100644 (file)
@@ -2,7 +2,6 @@ import importlib
 from types import ModuleType
 
 import pytest
-from dirty_equals import IsDict
 from fastapi.testclient import TestClient
 from sqlmodel import create_engine
 from sqlmodel.pool import StaticPool
@@ -137,28 +136,16 @@ def test_tutorial(module: ModuleType):
                         "required": ["name", "secret_name"],
                         "type": "object",
                         "properties": {
-                            "id": IsDict(
-                                {
-                                    "title": "Id",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Id", "type": "integer"}
-                            ),
+                            "id": {
+                                "title": "Id",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "ValidationError": {
index 3b028b7d91625404925a6e8da5ea586e8ae66d89..6982ee9913cea1a71480a2d4e6828c9e585286ea 100644 (file)
@@ -2,7 +2,6 @@ import importlib
 from types import ModuleType
 
 import pytest
-from dirty_equals import IsDict
 from fastapi.testclient import TestClient
 from sqlmodel import create_engine
 from sqlmodel.pool import StaticPool
@@ -534,26 +533,14 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
-                            "team_id": IsDict(
-                                {
-                                    "title": "Team Id",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Team Id", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
+                            "team_id": {
+                                "title": "Team Id",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "HeroPublic": {
@@ -563,26 +550,14 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
-                            "team_id": IsDict(
-                                {
-                                    "title": "Team Id",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Team Id", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
+                            "team_id": {
+                                "title": "Team Id",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
@@ -590,46 +565,22 @@ def test_tutorial(module: ModuleType):
                         "title": "HeroUpdate",
                         "type": "object",
                         "properties": {
-                            "name": IsDict(
-                                {
-                                    "title": "Name",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Name", "type": "string"}
-                            ),
-                            "secret_name": IsDict(
-                                {
-                                    "title": "Secret Name",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Secret Name", "type": "string"}
-                            ),
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
-                            "team_id": IsDict(
-                                {
-                                    "title": "Team Id",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Team Id", "type": "integer"}
-                            ),
+                            "name": {
+                                "title": "Name",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
+                            "secret_name": {
+                                "title": "Secret Name",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
+                            "team_id": {
+                                "title": "Team Id",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "TeamCreate": {
@@ -655,26 +606,14 @@ def test_tutorial(module: ModuleType):
                         "title": "TeamUpdate",
                         "type": "object",
                         "properties": {
-                            "name": IsDict(
-                                {
-                                    "title": "Name",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Name", "type": "string"}
-                            ),
-                            "headquarters": IsDict(
-                                {
-                                    "title": "Headquarters",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Headquarters", "type": "string"}
-                            ),
+                            "name": {
+                                "title": "Name",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
+                            "headquarters": {
+                                "title": "Headquarters",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
                         },
                     },
                     "ValidationError": {
index 9bc54fbcfb17f7734300c168ac7f2c5c4b0da597..cba5c1ae625e7306977633377da105f8679449b8 100644 (file)
@@ -2,7 +2,6 @@ import importlib
 from types import ModuleType
 
 import pytest
-from dirty_equals import IsDict
 from fastapi.testclient import TestClient
 from sqlmodel import create_engine
 from sqlmodel.pool import StaticPool
@@ -279,16 +278,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "HeroPublic": {
@@ -298,16 +291,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
@@ -315,36 +302,18 @@ def test_tutorial(module: ModuleType):
                         "title": "HeroUpdate",
                         "type": "object",
                         "properties": {
-                            "name": IsDict(
-                                {
-                                    "title": "Name",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Name", "type": "string"}
-                            ),
-                            "secret_name": IsDict(
-                                {
-                                    "title": "Secret Name",
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Secret Name", "type": "string"}
-                            ),
-                            "age": IsDict(
-                                {
-                                    "title": "Age",
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                }
-                            )
-                            | IsDict(
-                                # TODO: remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "name": {
+                                "title": "Name",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
+                            "secret_name": {
+                                "title": "Secret Name",
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                            },
+                            "age": {
+                                "title": "Age",
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                            },
                         },
                     },
                     "ValidationError": {
index ede67fe4e4bc7e7c99d5b35347cb0c04a633db79..22110ecb0327e2cb26801eb8e2e07f08661dd84e 100644 (file)
@@ -2,7 +2,6 @@ import importlib
 from types import ModuleType
 
 import pytest
-from dirty_equals import IsDict
 from fastapi.testclient import TestClient
 from sqlmodel import Session, create_engine
 from sqlmodel.pool import StaticPool
@@ -342,16 +341,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                    "title": "Age",
-                                }
-                            )
-                            | IsDict(
-                                # TODO: Remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                                "title": "Age",
+                            },
                             "password": {"type": "string", "title": "Password"},
                         },
                     },
@@ -362,16 +355,10 @@ def test_tutorial(module: ModuleType):
                         "properties": {
                             "name": {"title": "Name", "type": "string"},
                             "secret_name": {"title": "Secret Name", "type": "string"},
-                            "age": IsDict(
-                                {
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                    "title": "Age",
-                                }
-                            )
-                            | IsDict(
-                                # TODO: Remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
+                            "age": {
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                                "title": "Age",
+                            },
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
@@ -379,46 +366,22 @@ def test_tutorial(module: ModuleType):
                         "title": "HeroUpdate",
                         "type": "object",
                         "properties": {
-                            "name": IsDict(
-                                {
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                    "title": "Name",
-                                }
-                            )
-                            | IsDict(
-                                # TODO: Remove when deprecating Pydantic v1
-                                {"title": "Name", "type": "string"}
-                            ),
-                            "secret_name": IsDict(
-                                {
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                    "title": "Secret Name",
-                                }
-                            )
-                            | IsDict(
-                                # TODO: Remove when deprecating Pydantic v1
-                                {"title": "Secret Name", "type": "string"}
-                            ),
-                            "age": IsDict(
-                                {
-                                    "anyOf": [{"type": "integer"}, {"type": "null"}],
-                                    "title": "Age",
-                                }
-                            )
-                            | IsDict(
-                                # TODO: Remove when deprecating Pydantic v1
-                                {"title": "Age", "type": "integer"}
-                            ),
-                            "password": IsDict(
-                                {
-                                    "anyOf": [{"type": "string"}, {"type": "null"}],
-                                    "title": "Password",
-                                }
-                            )
-                            | IsDict(
-                                # TODO: Remove when deprecating Pydantic v1
-                                {"title": "Password", "type": "string"}
-                            ),
+                            "name": {
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                                "title": "Name",
+                            },
+                            "secret_name": {
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                                "title": "Secret Name",
+                            },
+                            "age": {
+                                "anyOf": [{"type": "integer"}, {"type": "null"}],
+                                "title": "Age",
+                            },
+                            "password": {
+                                "anyOf": [{"type": "string"}, {"type": "null"}],
+                                "title": "Password",
+                            },
                         },
                     },
                     "ValidationError": {