From 9ddb734d5abf43d39eaa48ce49b31f74c2728181 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Tue, 30 Apr 2019 01:44:01 -0700 Subject: [PATCH] Correct misspelled module 'typing' (#6616) https://docs.python.org/3/library/typing.html --- tests/test_fields.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_fields.py b/tests/test_fields.py index 12c936b2291..42adedfed9b 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -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. @@ -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)