🔥 Remove Pydantic v1 specific test variants (#14611)

This commit is contained in:
Sebastián Ramírez
2025-12-27 10:19:10 -08:00
committed by GitHub
parent 8322a4445a
commit 44c849c4fc
104 changed files with 4139 additions and 8074 deletions

View File

@@ -1,7 +1,6 @@
import importlib
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
from ...utils import needs_py310
@@ -67,16 +66,10 @@ def test_openapi_schema(client: TestClient):
"parameters": [
{
"required": False,
"schema": IsDict(
{
"anyOf": [{"type": "string"}, {"type": "null"}],
"title": "User-Agent",
}
)
| IsDict(
# TODO: remove when deprecating Pydantic v1
{"title": "User-Agent", "type": "string"}
),
"schema": {
"anyOf": [{"type": "string"}, {"type": "null"}],
"title": "User-Agent",
},
"name": "user-agent",
"in": "header",
}

View File

@@ -1,7 +1,6 @@
import importlib
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
from ...utils import needs_py310
@@ -78,16 +77,10 @@ def test_openapi_schema(client: TestClient):
"parameters": [
{
"required": False,
"schema": IsDict(
{
"anyOf": [{"type": "string"}, {"type": "null"}],
"title": "Strange Header",
}
)
| IsDict(
# TODO: remove when deprecating Pydantic v1
{"title": "Strange Header", "type": "string"}
),
"schema": {
"anyOf": [{"type": "string"}, {"type": "null"}],
"title": "Strange Header",
},
"name": "strange_header",
"in": "header",
}

View File

@@ -1,7 +1,6 @@
import importlib
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
from ...utils import needs_py310
@@ -56,23 +55,13 @@ def test_openapi_schema(client: TestClient):
"parameters": [
{
"required": False,
"schema": IsDict(
{
"title": "X-Token",
"anyOf": [
{"type": "array", "items": {"type": "string"}},
{"type": "null"},
],
}
)
| IsDict(
# TODO: remove when deprecating Pydantic v1
{
"title": "X-Token",
"type": "array",
"items": {"type": "string"},
}
),
"schema": {
"title": "X-Token",
"anyOf": [
{"type": "array", "items": {"type": "string"}},
{"type": "null"},
],
},
"name": "x-token",
"in": "header",
}