Skip to content

Commit b153cab

Browse files
[3.12] gh-108303: Move ann_module*.py files to typinganndata/ folder (GH-108354) (#109672)
gh-108303: Move `ann_module*.py` files to `typinganndata/` folder (GH-108354) (cherry picked from commit 3f61cf6) Co-authored-by: Nikita Sobolev <[email protected]>
1 parent 1dfb41d commit b153cab

13 files changed

+13
-8
lines changed

Lib/test/test_grammar.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
# different import patterns to check that __annotations__ does not interfere
1414
# with import machinery
15-
import test.ann_module as ann_module
15+
import test.typinganndata.ann_module as ann_module
1616
import typing
17-
from test import ann_module2
17+
from test.typinganndata import ann_module2
1818
import test
1919

2020
# These are shared with test_tokenize and other test modules.
@@ -467,7 +467,7 @@ def test_var_annot_module_semantics(self):
467467
def test_var_annot_in_module(self):
468468
# check that functions fail the same way when executed
469469
# outside of module where they were defined
470-
ann_module3 = import_helper.import_fresh_module("test.ann_module3")
470+
ann_module3 = import_helper.import_fresh_module("test.typinganndata.ann_module3")
471471
with self.assertRaises(NameError):
472472
ann_module3.f_bad_ann()
473473
with self.assertRaises(NameError):

Lib/test/test_inspect.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4584,7 +4584,7 @@ def func(*args, **kwargs):
45844584

45854585
def test_base_class_have_text_signature(self):
45864586
# see issue 43118
4587-
from test.ann_module7 import BufferedReader
4587+
from test.typinganndata.ann_module7 import BufferedReader
45884588
class MyBufferedReader(BufferedReader):
45894589
"""buffer reader class."""
45904590

Lib/test/test_module/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,9 @@ def test_annotations_getset_raises(self):
324324
del foo.__annotations__
325325

326326
def test_annotations_are_created_correctly(self):
327-
ann_module4 = import_helper.import_fresh_module('test.ann_module4')
327+
ann_module4 = import_helper.import_fresh_module(
328+
'test.typinganndata.ann_module4',
329+
)
328330
self.assertTrue("__annotations__" in ann_module4.__dict__)
329331
del ann_module4.__annotations__
330332
self.assertFalse("__annotations__" in ann_module4.__dict__)

Lib/test/test_opcodes.py

+2-1
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

+4-2
Original file line numberDiff line numberDiff line change
@@ -5306,7 +5306,7 @@ def test_errors(self):
53065306

53075307

53085308
# We need this to make sure that `@no_type_check` respects `__module__` attr:
5309-
from test import ann_module8
5309+
from test.typinganndata import ann_module8
53105310

53115311
@no_type_check
53125312
class NoTypeCheck_Outer:
@@ -5893,7 +5893,9 @@ def test_overload_registry_repeated(self):
58935893

58945894
# Definitions needed for features introduced in Python 3.6
58955895

5896-
from test import ann_module, ann_module2, ann_module3, ann_module5, ann_module6
5896+
from test.typinganndata import (
5897+
ann_module, ann_module2, ann_module3, ann_module5, ann_module6,
5898+
)
58975899

58985900
T_a = TypeVar('T_a')
58995901

File renamed without changes.
File renamed without changes.
File renamed without changes.
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)