Type annotate a variable to prevent future errors.

In zerver.tests.test_decorators.test_check_dict, the variable
'keys' has to be explicitly annotated to pass mypy 0.4.7.
See https://github.com/python/mypy/issues/2777 for more info.
This commit is contained in:
Eklavya Sharma 2017-01-31 14:04:18 +05:30 committed by Tim Abbott
parent 50800d4993
commit 0badbbf0e2
1 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import mock import mock
from typing import Any, Iterable, Optional, Text from typing import Any, Iterable, List, Optional, Text, Tuple
from django.test import TestCase from django.test import TestCase
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.http import HttpResponse, HttpRequest from django.http import HttpResponse, HttpRequest
@ -31,7 +31,7 @@ from zerver.decorator import (
return_success_on_head_request return_success_on_head_request
) )
from zerver.lib.validator import ( from zerver.lib.validator import (
check_string, check_dict, check_bool, check_int, check_list check_string, check_dict, check_bool, check_int, check_list, Validator
) )
from zerver.models import \ from zerver.models import \
get_realm, get_user_profile_by_email, UserProfile, Client get_realm, get_user_profile_by_email, UserProfile, Client
@ -427,7 +427,7 @@ class ValidatorTestCase(TestCase):
keys = [ keys = [
('names', check_list(check_string)), ('names', check_list(check_string)),
('city', check_string), ('city', check_string),
] ] # type: List[Tuple[str, Validator]]
x = { x = {
'names': ['alice', 'bob'], 'names': ['alice', 'bob'],