]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-108303: Move `ann_module*.py` files to `typinganndata/` folder (#108354...
authorVictor Stinner <vstinner@python.org>
Thu, 21 Sep 2023 18:18:39 +0000 (20:18 +0200)
committerGitHub <noreply@github.com>
Thu, 21 Sep 2023 18:18:39 +0000 (18:18 +0000)
gh-108303: Move `ann_module*.py` files to `typinganndata/` folder (#108354)

(cherry picked from commit 3f61cf646d0506baa0c0c2118f05110446519c62)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
13 files changed:
Lib/test/test_grammar.py
Lib/test/test_inspect.py
Lib/test/test_module/__init__.py
Lib/test/test_opcodes.py
Lib/test/test_typing.py
Lib/test/typinganndata/ann_module.py [moved from Lib/test/ann_module.py with 100% similarity]
Lib/test/typinganndata/ann_module2.py [moved from Lib/test/ann_module2.py with 100% similarity]
Lib/test/typinganndata/ann_module3.py [moved from Lib/test/ann_module3.py with 100% similarity]
Lib/test/typinganndata/ann_module4.py [moved from Lib/test/ann_module4.py with 100% similarity]
Lib/test/typinganndata/ann_module5.py [moved from Lib/test/ann_module5.py with 100% similarity]
Lib/test/typinganndata/ann_module6.py [moved from Lib/test/ann_module6.py with 100% similarity]
Lib/test/typinganndata/ann_module7.py [moved from Lib/test/ann_module7.py with 100% similarity]
Lib/test/typinganndata/ann_module8.py [moved from Lib/test/ann_module8.py with 100% similarity]

index f1f9b5c00751001494948f7f7db5054f60abacbf..a00280b184e6965b12d1189c8576240ca45c30e0 100644 (file)
@@ -13,10 +13,9 @@ from sys import *
 
 # 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.
@@ -472,7 +471,7 @@ class GrammarTests(unittest.TestCase):
     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):
index fb4cba0572108232a873849ada7cf5e2b1f3b46e..f5824778d1e5d6722071c906739c943965a8aaf0 100644 (file)
@@ -4353,7 +4353,7 @@ class TestSignatureDefinitions(unittest.TestCase):
 
     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."""
 
index 87d1a8e3d6c97858cdd445d540b9ba6f4f8484ab..c2bca45bb60c44fd20a9ba4ef31da2734f4ee55d 100644 (file)
@@ -326,7 +326,9 @@ a = A(destroyed)"""
             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__)
index e880c3f1ac875e049683f7c801c166c8b75a7a27..72488b2bb6b4ff4cdc040850307295c7336ea72e 100644 (file)
@@ -1,7 +1,8 @@
 # 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):
 
index 03988758541f062b127af6343b94cd90b8e672eb..149c29283d4bae10e196ef623f8a1c3340b971b2 100644 (file)
@@ -4641,7 +4641,7 @@ class AssertTypeTests(BaseTestCase):
 
 
 # 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:
@@ -5228,7 +5228,9 @@ class OverloadTests(BaseTestCase):
 
 # 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')