Skip to content

Commit bff9b81

Browse files
committed
fix(test): target pydantic v2 only in arbitrary type
1 parent 2bcd248 commit bff9b81

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/functional/event_handler/_pydantic/test_openapi_encoders.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import List
44

55
import pytest
6-
from pydantic import BaseModel
6+
from pydantic import BaseModel, ConfigDict
77
from pydantic.color import Color
88

99
from aws_lambda_powertools.event_handler.openapi.encoders import jsonable_encoder
@@ -230,6 +230,7 @@ def serializer(value):
230230
assert result == ["serialized"]
231231

232232

233+
@pytest.mark.usefixtures("pydanticv2_only")
233234
def test_openapi_encode_custom_serializer_pydantic():
234235
# GIVEN a sequence with a custom class
235236
class CustomClass:
@@ -238,9 +239,7 @@ class CustomClass:
238239
class Order(BaseModel):
239240
kind: CustomClass
240241

241-
# maintenance: deprecate in V3; becomes model_config =ConfigDict(<directive>=True)
242-
class Config:
243-
arbitrary_types_allowed = True
242+
model_config = ConfigDict(arbitrary_types_allowed=True)
244243

245244
order = Order(kind=CustomClass())
246245

0 commit comments

Comments
 (0)