1- from sys import version_info
21from typing import Annotated , TypeAlias
32
4- import pytest
53from sqlmodel import Field , SQLModel
64
5+ from tests .conftest import needs_py312
76
8- @pytest .mark .skipif (version_info [1 ] < 12 , reason = "Language feature of Python 3.12+" )
7+
8+ @needs_py312
99def test_sa_type_1 () -> None :
1010 Type1 = str
1111
@@ -14,7 +14,7 @@ class Hero1(SQLModel, table=True):
1414 weapon : Type1 = "sword"
1515
1616
17- @pytest . mark . skipif ( version_info [ 1 ] < 12 , reason = "Language feature of Python 3.12+" )
17+ @needs_py312
1818def test_sa_type_2 () -> None :
1919 Type2 = Annotated [str , "Just a comment" ]
2020
@@ -26,7 +26,7 @@ class Hero(SQLModel, table=True):
2626Type3 : TypeAlias = str
2727
2828
29- @pytest . mark . skipif ( version_info [ 1 ] < 12 , reason = "Language feature of Python 3.12+" )
29+ @needs_py312
3030def test_sa_type_3 () -> None :
3131 class Hero (SQLModel , table = True ):
3232 pk : int = Field (primary_key = True )
@@ -36,14 +36,14 @@ class Hero(SQLModel, table=True):
3636Type4 : TypeAlias = Annotated [str , "Just a comment" ]
3737
3838
39- @pytest . mark . skipif ( version_info [ 1 ] < 12 , reason = "Language feature of Python 3.12+" )
39+ @needs_py312
4040def test_sa_type_4 () -> None :
4141 class Hero (SQLModel , table = True ):
4242 pk : int = Field (primary_key = True )
4343 weapon : Type4 = "sword"
4444
4545
46- @pytest . mark . skipif ( version_info [ 1 ] < 12 , reason = "Language feature of Python 3.12+" )
46+ @needs_py312
4747def test_sa_type_5 () -> None :
4848 type Type5 = str
4949
@@ -52,7 +52,7 @@ class Hero(SQLModel, table=True):
5252 weapon : Type5 = "sword"
5353
5454
55- @pytest . mark . skipif ( version_info [ 1 ] < 12 , reason = "Language feature of Python 3.12+" )
55+ @needs_py312
5656def test_sa_type_6 () -> None :
5757 type Type6 = Annotated [str , "Just a comment" ]
5858
0 commit comments