File tree Expand file tree Collapse file tree 3 files changed +36
-1
lines changed Expand file tree Collapse file tree 3 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ async-exit-stack; python_version=='3.6'
44
55# Backends
66ormar
7- tortoise-orm
7+ tortoise-orm==0.17.8; python_version>='3.7'
88databases
99aiosqlite
1010sqlalchemy==1.3.22
Original file line number Diff line number Diff line change 1+ import pathlib
2+
3+ file = pathlib .Path (__file__ )
4+ root_dir = file .parent .parent .parent
5+ package_src = root_dir / "fastapi_crudrouter"
6+
7+
8+ def test_py_typed_file_exists ():
9+ assert (package_src / "py.typed" ).exists ()
10+ assert (package_src / "py.typed" ).is_file ()
11+
12+
13+ def test_virtualenv (virtualenv ):
14+ assert (root_dir ).exists ()
15+ assert (root_dir / "setup.py" ).exists ()
16+
17+ virtualenv .run (f"pip install -e { root_dir } " )
18+ virtualenv .run (f"pip install mypy" )
19+ virtualenv .run (f"mypy { file } " )
20+
21+
22+ if __name__ == "__main__" :
23+ from pydantic import BaseModel
24+ from fastapi import FastAPI
25+
26+ import fastapi_crudrouter
27+
28+ class User (BaseModel ):
29+ id : int
30+ name : str
31+ email : str
32+
33+ router = fastapi_crudrouter .MemoryCRUDRouter (schema = User )
34+ app = FastAPI ()
35+ app .include_router (router )
You can’t perform that action at this time.
0 commit comments