FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sqlmodel/tests/test_tutorial/test_where/test_tutorial008.py at main · fastapi/sqlmodel · GitHub
fastapi
sqlmodel
Repository navigation
Code
Issues
1
(1)
Pull requests
52
(52)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
sqlmodel
/
tests
/
test_tutorial
/
test_where
/
test_tutorial008.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (21 loc) · 723 Bytes
Breadcrumbs
sqlmodel
/
tests
/
test_tutorial
/
test_where
/
test_tutorial008.py
Copy path
File metadata and controls
27 lines (21 loc) · 723 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
23
24
25
26
27
import
importlib
from
types
import
ModuleType
import
pytest
from
sqlalchemy
import
Engine
from
...
conftest
import
PrintMock
@
pytest
.
fixture
(
name
=
"mod"
,
params
=
[
pytest
.
param
(
"tutorial008_py310"
),
],
)
def
get_module
(
request
:
pytest
.
FixtureRequest
,
database_engine
:
Engine
)
->
ModuleType
:
mod
=
importlib
.
import_module
(
f"docs_src.tutorial.where.
{
request
.
param
}
"
)
mod
.
engine
=
database_engine
return
mod
def
test_tutorial
(
print_mock
:
PrintMock
,
mod
:
ModuleType
):
mod
.
main
()
assert
print_mock
.
calls
==
[
[{
"id"
:
5
,
"name"
:
"Black Lion"
,
"secret_name"
:
"Trevor Challa"
,
"age"
:
35
}],
[{
"id"
:
6
,
"name"
:
"Dr. Weird"
,
"secret_name"
:
"Steve Weird"
,
"age"
:
36
}],
]
Back
|
FazBrowse Home
|
New Git URL