Skip to content

Commit e59ee6c

Browse files
vstinnersobolevn
andauthored
[3.11] pythongh-108303: Move ann_module*.py files to typinganndata/ folder (python#108354) (python#109673)
pythongh-108303: Move `ann_module*.py` files to `typinganndata/` folder (python#108354) (cherry picked from commit 3f61cf6) Co-authored-by: Nikita Sobolev <[email protected]>
1 parent 3ba4dfe commit e59ee6c

File tree

13 files changed

+13
-9
lines changed

13 files changed

+13
-9
lines changed

Lib/test/test_grammar.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313

1414
# different import patterns to check that __annotations__ does not interfere
1515
# with import machinery
16-
import test.ann_module as ann_module
16+
import test.typinganndata.ann_module as ann_module
1717
import typing
18-
from collections import ChainMap
19-
from test import ann_module2
18+
from test.typinganndata import ann_module2
2019
import test
2120

2221
# These are shared with test_tokenize and other test modules.
@@ -472,7 +471,7 @@ def test_var_annot_module_semantics(self):
472471
def test_var_annot_in_module(self):
473472
# check that functions fail the same way when executed
474473
# outside of module where they were defined
475-
ann_module3 = import_helper.import_fresh_module("test.ann_module3")
474+
ann_module3 = import_helper.import_fresh_module("test.typinganndata.ann_module3")
476475
with self.assertRaises(NameError):
477476
ann_module3.f_bad_ann()
478477
with self.assertRaises(NameError):

Lib/test/test_inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4353,7 +4353,7 @@ def func(*args, **kwargs):
43534353

43544354
def test_base_class_have_text_signature(self):
43554355
# see issue 43118
4356-
from test.ann_module7 import BufferedReader
4356+
from test.typinganndata.ann_module7 import BufferedReader
43574357
class MyBufferedReader(BufferedReader):
43584358
"""buffer reader class."""
43594359

Lib/test/test_module/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ def test_annotations_getset_raises(self):
326326
del foo.__annotations__
327327

328328
def test_annotations_are_created_correctly(self):
329-
ann_module4 = import_helper.import_fresh_module('test.ann_module4')
329+
ann_module4 = import_helper.import_fresh_module(
330+
'test.typinganndata.ann_module4',
331+
)
330332
self.assertTrue("__annotations__" in ann_module4.__dict__)
331333
del ann_module4.__annotations__
332334
self.assertFalse("__annotations__" in ann_module4.__dict__)

Lib/test/test_opcodes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Python test set -- part 2, opcodes
22

33
import unittest
4-
from test import ann_module, support
4+
from test import support
5+
from test.typinganndata import ann_module
56

67
class OpcodeTest(unittest.TestCase):
78

Lib/test/test_typing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4641,7 +4641,7 @@ def test_errors(self):
46414641

46424642

46434643
# We need this to make sure that `@no_type_check` respects `__module__` attr:
4644-
from test import ann_module8
4644+
from test.typinganndata import ann_module8
46454645

46464646
@no_type_check
46474647
class NoTypeCheck_Outer:
@@ -5228,7 +5228,9 @@ def test_overload_registry_repeated(self):
52285228

52295229
# Definitions needed for features introduced in Python 3.6
52305230

5231-
from test import ann_module, ann_module2, ann_module3, ann_module5, ann_module6
5231+
from test.typinganndata import (
5232+
ann_module, ann_module2, ann_module3, ann_module5, ann_module6,
5233+
)
52325234

52335235
T_a = TypeVar('T_a')
52345236

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)