|
| 1 | +import sys |
1 | 2 | from typing import Annotated, TypeAlias |
2 | 3 |
|
3 | 4 | from sqlmodel import Field, SQLModel |
@@ -43,19 +44,20 @@ class Hero(SQLModel, table=True): |
43 | 44 | weapon: Type4 = "sword" |
44 | 45 |
|
45 | 46 |
|
46 | | -@needs_py312 |
47 | | -def test_sa_type_5() -> None: |
48 | | - type Type5 = str |
| 47 | +if sys.version_info >= (3, 12): |
49 | 48 |
|
50 | | - class Hero(SQLModel, table=True): |
51 | | - pk: int = Field(primary_key=True) |
52 | | - weapon: Type5 = "sword" |
| 49 | + @needs_py312 |
| 50 | + def test_sa_type_5() -> None: |
| 51 | + type Type5 = str |
53 | 52 |
|
| 53 | + class Hero(SQLModel, table=True): |
| 54 | + pk: int = Field(primary_key=True) |
| 55 | + weapon: Type5 = "sword" |
54 | 56 |
|
55 | | -@needs_py312 |
56 | | -def test_sa_type_6() -> None: |
57 | | - type Type6 = Annotated[str, "Just a comment"] |
| 57 | + @needs_py312 |
| 58 | + def test_sa_type_6() -> None: |
| 59 | + type Type6 = Annotated[str, "Just a comment"] |
58 | 60 |
|
59 | | - class Hero(SQLModel, table=True): |
60 | | - pk: int = Field(primary_key=True) |
61 | | - weapon: Type6 = "sword" |
| 61 | + class Hero(SQLModel, table=True): |
| 62 | + pk: int = Field(primary_key=True) |
| 63 | + weapon: Type6 = "sword" |
0 commit comments