Skip to content

Commit 72e8c36

Browse files
committed
fix: Skip alias tests in Pydantic v1
1 parent 785270a commit 72e8c36

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/test_aliases.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,14 @@ class SQLModelUserV2(SQLModel):
143143
)
144144

145145

146+
@pytest.mark.skipif(not VERSION.startswith("2."), reason="validation_alias and serialization_alias are not supported in Pydantic v1")
146147
@pytest.mark.parametrize("model", [PydanticUserV2, SQLModelUserV2])
147148
def test_create_with_validation_alias(model: Union[Type[PydanticUserV2], Type[SQLModelUserV2]]):
148149
user = model(firstName="John")
149150
assert user.first_name == "John"
150151

151152

153+
@pytest.mark.skipif(not VERSION.startswith("2."), reason="validation_alias and serialization_alias are not supported in Pydantic v1")
152154
@pytest.mark.parametrize("model", [PydanticUserV2, SQLModelUserV2])
153155
def test_serialize_with_serialization_alias(
154156
model: Union[Type[PydanticUserV2], Type[SQLModelUserV2]]

0 commit comments

Comments
 (0)