Add type hints to all test code (#1217)

* Add type hints to all test code

* Fixes

* Fix indentation

* Review fixes
This commit is contained in:
Marti Raudsepp
2022-10-31 11:20:10 +02:00
committed by GitHub
parent 9b4162beb1
commit e3c131bc61
16 changed files with 72 additions and 53 deletions

View File

@@ -14,22 +14,24 @@
- case: dispatch_http_response
main: |
from django.http import HttpResponse
from typing import Any
from django.http import HttpRequest, HttpResponse
from django.views.generic.base import View
class MyView(View):
def dispatch(self, request, *args, **kwargs) -> HttpResponse:
def dispatch(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
response: HttpResponse
return response
- case: dispatch_streaming_http_response
main: |
from django.http import StreamingHttpResponse
from typing import Any
from django.http import HttpRequest, StreamingHttpResponse
from django.views.generic.base import View
class MyView(View):
def dispatch(self, request, *args, **kwargs) -> StreamingHttpResponse:
def dispatch(self, request: HttpRequest, *args: Any, **kwargs: Any) -> StreamingHttpResponse:
response: StreamingHttpResponse
return response