Update tests, remove conditionals for Pydantic v1 (#1702)

This commit is contained in:
Sebastián Ramírez
2025-12-28 05:08:19 -08:00
committed by GitHub
parent 2cc11dada3
commit 8dbcd643d3
12 changed files with 230 additions and 584 deletions

View 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"},
},
},