Skip to content

Commit

Permalink
mypy test new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalik committed Oct 1, 2023
1 parent 1662760 commit 6e17850
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,4 @@ jobs:
- name: Ruff
run: ruff ninja tests
- name: mypy
run: mypy ninja

run: mypy ninja tests/mypy_test.py
10 changes: 5 additions & 5 deletions tests/mypy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ class Payload(Schema):


@api.post("/old_way")
def old_way(request: HttpRequest, data: Payload = Body()) -> Any:
def old_way(_request: HttpRequest, data: Payload = Body()) -> Any:
data.s.capitalize()


@api.post("/annotated_way")
def annotated_way(request: HttpRequest, data: Annotated[Payload, Body()]) -> Any:
def annotated_way(_request: HttpRequest, data: Annotated[Payload, Body()]) -> Any:
data.s.capitalize()


@api.post("/new_way")
def new_way(request: HttpRequest, data: Body[Payload]) -> Any:
def new_way(_request: HttpRequest, data: Body[Payload]) -> Any:
data.s.capitalize()


@api.post("/new_way_ex")
def new_way_ex(request: HttpRequest, data: BodyEx[Payload, P(title="A title")]) -> Any:
data.s.find("", "")
def new_way_ex(_request: HttpRequest, data: BodyEx[Payload, P(title="A title")]) -> Any:
data.s.find("")

0 comments on commit 6e17850

Please sign in to comment.