Skip to content

Commit

Permalink
Type annotate a variable to prevent future errors.
Browse files Browse the repository at this point in the history
In zerver.tests.test_decorators.test_check_dict, the variable
'keys' has to be explicitly annotated to pass mypy 0.4.7.
See python/mypy#2777 for more info.
  • Loading branch information
sharmaeklavya2 authored and timabbott committed Feb 7, 2017
1 parent 50800d4 commit 0badbbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zerver/tests/test_decorators.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
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.utils.translation import ugettext as _
from django.http import HttpResponse, HttpRequest
Expand Down Expand Up @@ -31,7 +31,7 @@
return_success_on_head_request
)
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 \
get_realm, get_user_profile_by_email, UserProfile, Client
Expand Down Expand Up @@ -427,7 +427,7 @@ def test_check_dict(self):
keys = [
('names', check_list(check_string)),
('city', check_string),
]
] # type: List[Tuple[str, Validator]]

x = {
'names': ['alice', 'bob'],
Expand Down

0 comments on commit 0badbbf

Please sign in to comment.