FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sqlmodel/tests/test_missing_type.py at main · EndexAI/sqlmodel · GitHub
EndexAI
sqlmodel
Repository navigation
Code
Pull requests
1
(1)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
sqlmodel
/
tests
/
test_missing_type.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (16 loc) · 536 Bytes
Breadcrumbs
sqlmodel
/
tests
/
test_missing_type.py
Copy path
File metadata and controls
22 lines (16 loc) · 536 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from
typing
import
Optional
import
pytest
from
pydantic
import
BaseModel
from
sqlmodel
import
Field
,
SQLModel
def
test_missing_sql_type
():
class
CustomType
(
BaseModel
):
@
classmethod
def
__get_validators__
(
cls
):
yield
cls
.
validate
@
classmethod
def
validate
(
cls
,
v
):
# pragma: no cover
return
v
with
pytest
.
raises
(
ValueError
):
class
Item
(
SQLModel
,
table
=
True
):
id
:
Optional
[
int
]
=
Field
(
default
=
None
,
primary_key
=
True
)
item
:
CustomType
Back
|
FazBrowse Home
|
New Git URL