Skip to content

Commit

Permalink
Correct misspelled module 'typing' (encode#6616)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdufresne authored and Pierre Chiquet committed Mar 24, 2020
1 parent 0123aa0 commit 9ddb734
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
from rest_framework.fields import DjangoImageField, is_simple_callable

try:
import typings
import typing
except ImportError:
typings = False
typing = False


# Tests for helper functions.
Expand Down Expand Up @@ -93,11 +93,12 @@ class Meta:

assert is_simple_callable(ChoiceModel().get_choice_field_display)

@unittest.skipUnless(typings, 'requires python 3.5')
@unittest.skipUnless(typing, 'requires python 3.5')
def test_type_annotation(self):
# The annotation will otherwise raise a syntax error in python < 3.5
exec("def valid(param: str='value'): pass", locals())
valid = locals()['valid']
locals = {}
exec("def valid(param: str='value'): pass", locals)
valid = locals['valid']

assert is_simple_callable(valid)

Expand Down

0 comments on commit 9ddb734

Please sign in to comment.