Skip to content

Commit 93e15c1

Browse files
committed
Add tests for syntax declaration
1 parent 66e1bfe commit 93e15c1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_declaration_syntax.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from typing import Annotated
2+
3+
from sqlmodel import SQLModel, Field
4+
5+
6+
def test_declaration_syntax_1():
7+
class Person1(SQLModel, table=True):
8+
name: str = Field(primary_key=True)
9+
10+
11+
def test_declaration_syntax_2():
12+
class Person2(SQLModel, table=True):
13+
name: Annotated[str, Field(primary_key=True)]
14+
15+
16+
def test_declaration_syntax_3():
17+
class Person3(SQLModel, table=True):
18+
name: Annotated[str, ...] = Field(primary_key=True)

0 commit comments

Comments
 (0)