File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import pytest
55from pydantic import ValidationError
66from sqlmodel import Field , Session , SQLModel , create_engine
7+ from sqlmodel ._compat import PYDANTIC_MINOR_VERSION
78
89
910def test_decimal ():
@@ -177,6 +178,10 @@ class Model(SQLModel):
177178 assert model_schema ["properties" ]["another_old_field" ]["deprecated" ] is True
178179
179180
181+ @pytest .mark .skipif (
182+ PYDANTIC_MINOR_VERSION < (2 , 12 ),
183+ reason = "exlude_if requires Pydantic 2.12+" ,
184+ )
180185def test_exclude_if ():
181186 def is_empty_string (value : Any ) -> bool :
182187 return value == ""
@@ -197,6 +202,10 @@ class Model(SQLModel):
197202 assert "name" not in dict2
198203
199204
205+ @pytest .mark .skipif (
206+ PYDANTIC_MINOR_VERSION < (2 , 12 ),
207+ reason = "exlude_if requires Pydantic 2.12+" ,
208+ )
200209def test_exclude_if_via_schema_extra ():
201210 def is_empty_string (value : Any ) -> bool :
202211 return value == ""
You can’t perform that action at this time.
0 commit comments