44import pytest
55from sqlmodel import Field , SQLModel
66
7- Type5 : TypeAlias = str
8- Type6 : TypeAlias = Annotated [str , "Just a comment" ]
9-
107
118@pytest .mark .skipif (version_info [1 ] < 12 , reason = "Language feature of Python 3.12+" )
129def test_sa_type_1 () -> None :
@@ -26,33 +23,39 @@ class Hero(SQLModel, table=True):
2623 weapon : Type2 = "sword"
2724
2825
26+ Type3 : TypeAlias = str
27+
28+
2929@pytest .mark .skipif (version_info [1 ] < 12 , reason = "Language feature of Python 3.12+" )
3030def test_sa_type_3 () -> None :
31- type Type3 = str
32-
3331 class Hero (SQLModel , table = True ):
3432 pk : int = Field (primary_key = True )
3533 weapon : Type3 = "sword"
3634
3735
36+ Type4 : TypeAlias = Annotated [str , "Just a comment" ]
37+
38+
3839@pytest .mark .skipif (version_info [1 ] < 12 , reason = "Language feature of Python 3.12+" )
3940def test_sa_type_4 () -> None :
40- type Type4 = Annotated [str , "Just a comment" ]
41-
4241 class Hero (SQLModel , table = True ):
4342 pk : int = Field (primary_key = True )
4443 weapon : Type4 = "sword"
4544
4645
4746@pytest .mark .skipif (version_info [1 ] < 12 , reason = "Language feature of Python 3.12+" )
4847def test_sa_type_5 () -> None :
48+ type Type5 = str # type: ignore[invalid-syntax]
49+
4950 class Hero (SQLModel , table = True ):
5051 pk : int = Field (primary_key = True )
5152 weapon : Type5 = "sword"
5253
5354
5455@pytest .mark .skipif (version_info [1 ] < 12 , reason = "Language feature of Python 3.12+" )
5556def test_sa_type_6 () -> None :
57+ type Type6 = Annotated [str , "Just a comment" ] # type: ignore[invalid-syntax]
58+
5659 class Hero (SQLModel , table = True ):
5760 pk : int = Field (primary_key = True )
5861 weapon : Type6 = "sword"
0 commit comments