File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ import pathlib
2+
3+ file = pathlib .Path (__file__ )
4+ package = file .parent .parent .parent / "fastapi_crudrouter"
5+
6+
7+ def test_py_typed_file_exists ():
8+ assert (package / "py.typed" ).exists ()
9+ assert (package / "py.typed" ).is_file ()
10+
11+
12+ def test_virtualenv (virtualenv ):
13+ assert (package ).exists ()
14+
15+ virtualenv .run (f"pip install -e { package } " )
16+ virtualenv .run (f"pip install mypy" )
17+ virtualenv .run (f"mypy { file } " )
18+
19+
20+ if __name__ == "__main__" :
21+ from pydantic import BaseModel
22+ from fastapi import FastAPI
23+
24+ import fastapi_crudrouter
25+
26+ class User (BaseModel ):
27+ id : int
28+ name : str
29+ email : str
30+
31+ router = fastapi_crudrouter .MemoryCRUDRouter (schema = User )
32+ app = FastAPI ()
33+ app .include_router (router )
You can’t perform that action at this time.
0 commit comments