mypy: Clarify parameter types in test_decorators.py.

This commit is contained in:
neiljp (Neil Pilgrim) 2017-11-02 11:55:26 -07:00 committed by Tim Abbott
parent 6e6b1ce0d5
commit 055dff9038
1 changed files with 3 additions and 3 deletions

View File

@ -187,7 +187,7 @@ class DecoratorTestCase(TestCase):
# type: () -> None
@has_request_variables
def get_payload(request, payload=REQ(argument_type='body')):
# type: (HttpRequest, Dict[str, Dict]) -> Dict[str, Dict]
# type: (HttpRequest, Dict[str, Any]) -> Dict[str, Any]
return payload
class MockRequest(object):
@ -207,7 +207,7 @@ class DecoratorTestCase(TestCase):
with self.assertRaises(Exception) as cm:
@has_request_variables
def test(request, payload=REQ(argument_type="invalid")):
# type: (HttpRequest, Dict[str, Dict]) -> None
# type: (HttpRequest, Any) -> None # Any is ok; exception should occur in decorator
pass # nocoverage # this function isn't meant to be called
test(request)
@ -953,7 +953,7 @@ class TestInternalNotifyView(TestCase):
class Request(object):
def __init__(self, POST, META):
# type: (Dict, Dict) -> None
# type: (Dict[str, Any], Dict[str, Any]) -> None
self.POST = POST
self.META = META
self.method = 'POST'