# different import patterns to check that __annotations__ does not interfere
# with import machinery
-import test.ann_module as ann_module
+import test.typinganndata.ann_module as ann_module
import typing
-from collections import ChainMap
-from test import ann_module2
+from test.typinganndata import ann_module2
import test
# These are shared with test_tokenize and other test modules.
def test_var_annot_in_module(self):
# check that functions fail the same way when executed
# outside of module where they were defined
- ann_module3 = import_helper.import_fresh_module("test.ann_module3")
+ ann_module3 = import_helper.import_fresh_module("test.typinganndata.ann_module3")
with self.assertRaises(NameError):
ann_module3.f_bad_ann()
with self.assertRaises(NameError):
def test_base_class_have_text_signature(self):
# see issue 43118
- from test.ann_module7 import BufferedReader
+ from test.typinganndata.ann_module7 import BufferedReader
class MyBufferedReader(BufferedReader):
"""buffer reader class."""
del foo.__annotations__
def test_annotations_are_created_correctly(self):
- ann_module4 = import_helper.import_fresh_module('test.ann_module4')
+ ann_module4 = import_helper.import_fresh_module(
+ 'test.typinganndata.ann_module4',
+ )
self.assertTrue("__annotations__" in ann_module4.__dict__)
del ann_module4.__annotations__
self.assertFalse("__annotations__" in ann_module4.__dict__)
# Python test set -- part 2, opcodes
import unittest
-from test import ann_module, support
+from test import support
+from test.typinganndata import ann_module
class OpcodeTest(unittest.TestCase):
# We need this to make sure that `@no_type_check` respects `__module__` attr:
-from test import ann_module8
+from test.typinganndata import ann_module8
@no_type_check
class NoTypeCheck_Outer:
# Definitions needed for features introduced in Python 3.6
-from test import ann_module, ann_module2, ann_module3, ann_module5, ann_module6
+from test.typinganndata import (
+ ann_module, ann_module2, ann_module3, ann_module5, ann_module6,
+)
T_a = TypeVar('T_a')