mirror of
https://github.com/fastapi/fastapi.git
synced 2026-04-07 16:40:31 -04:00
🔥 Remove Pydantic v1 specific test variants (#14611)
This commit is contained in:
committed by
GitHub
parent
8322a4445a
commit
44c849c4fc
@@ -2,7 +2,7 @@ import importlib
|
||||
import warnings
|
||||
|
||||
import pytest
|
||||
from dirty_equals import IsDict, IsInt
|
||||
from dirty_equals import IsInt
|
||||
from fastapi.testclient import TestClient
|
||||
from inline_snapshot import snapshot
|
||||
from sqlalchemy import StaticPool
|
||||
@@ -318,33 +318,15 @@ def test_openapi_schema(client: TestClient):
|
||||
},
|
||||
"Hero": {
|
||||
"properties": {
|
||||
"id": IsDict(
|
||||
{
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
"title": "Id",
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"type": "integer",
|
||||
"title": "Id",
|
||||
}
|
||||
),
|
||||
"id": {
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
"title": "Id",
|
||||
},
|
||||
"name": {"type": "string", "title": "Name"},
|
||||
"age": IsDict(
|
||||
{
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
"title": "Age",
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"type": "integer",
|
||||
"title": "Age",
|
||||
}
|
||||
),
|
||||
"age": {
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
"title": "Age",
|
||||
},
|
||||
"secret_name": {"type": "string", "title": "Secret Name"},
|
||||
},
|
||||
"type": "object",
|
||||
|
||||
@@ -2,7 +2,7 @@ import importlib
|
||||
import warnings
|
||||
|
||||
import pytest
|
||||
from dirty_equals import IsDict, IsInt
|
||||
from dirty_equals import IsInt
|
||||
from fastapi.testclient import TestClient
|
||||
from inline_snapshot import Is, snapshot
|
||||
from sqlalchemy import StaticPool
|
||||
@@ -373,19 +373,10 @@ def test_openapi_schema(client: TestClient):
|
||||
"HeroCreate": {
|
||||
"properties": {
|
||||
"name": {"type": "string", "title": "Name"},
|
||||
"age": IsDict(
|
||||
{
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
"title": "Age",
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"type": "integer",
|
||||
"title": "Age",
|
||||
}
|
||||
),
|
||||
"age": {
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
"title": "Age",
|
||||
},
|
||||
"secret_name": {"type": "string", "title": "Secret Name"},
|
||||
},
|
||||
"type": "object",
|
||||
@@ -395,19 +386,10 @@ def test_openapi_schema(client: TestClient):
|
||||
"HeroPublic": {
|
||||
"properties": {
|
||||
"name": {"type": "string", "title": "Name"},
|
||||
"age": IsDict(
|
||||
{
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
"title": "Age",
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"type": "integer",
|
||||
"title": "Age",
|
||||
}
|
||||
),
|
||||
"age": {
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
"title": "Age",
|
||||
},
|
||||
"id": {"type": "integer", "title": "Id"},
|
||||
},
|
||||
"type": "object",
|
||||
@@ -416,45 +398,18 @@ def test_openapi_schema(client: TestClient):
|
||||
},
|
||||
"HeroUpdate": {
|
||||
"properties": {
|
||||
"name": IsDict(
|
||||
{
|
||||
"anyOf": [{"type": "string"}, {"type": "null"}],
|
||||
"title": "Name",
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"type": "string",
|
||||
"title": "Name",
|
||||
}
|
||||
),
|
||||
"age": IsDict(
|
||||
{
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
"title": "Age",
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"type": "integer",
|
||||
"title": "Age",
|
||||
}
|
||||
),
|
||||
"secret_name": IsDict(
|
||||
{
|
||||
"anyOf": [{"type": "string"}, {"type": "null"}],
|
||||
"title": "Secret Name",
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"type": "string",
|
||||
"title": "Secret Name",
|
||||
}
|
||||
),
|
||||
"name": {
|
||||
"anyOf": [{"type": "string"}, {"type": "null"}],
|
||||
"title": "Name",
|
||||
},
|
||||
"age": {
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
"title": "Age",
|
||||
},
|
||||
"secret_name": {
|
||||
"anyOf": [{"type": "string"}, {"type": "null"}],
|
||||
"title": "Secret Name",
|
||||
},
|
||||
},
|
||||
"type": "object",
|
||||
"title": "HeroUpdate",
|
||||
|
||||
Reference in New Issue
Block a user