mirror of
https://github.com/python/cpython.git
synced 2025-08-11 04:19:06 +00:00
[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 3f61cf646d
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
1dfb41d262
commit
b153cab6d8
13 changed files with 13 additions and 8 deletions
|
@ -12,9 +12,9 @@ from sys import *
|
||||||
|
|
||||||
# different import patterns to check that __annotations__ does not interfere
|
# different import patterns to check that __annotations__ does not interfere
|
||||||
# with import machinery
|
# with import machinery
|
||||||
import test.ann_module as ann_module
|
import test.typinganndata.ann_module as ann_module
|
||||||
import typing
|
import typing
|
||||||
from test import ann_module2
|
from test.typinganndata import ann_module2
|
||||||
import test
|
import test
|
||||||
|
|
||||||
# These are shared with test_tokenize and other test modules.
|
# These are shared with test_tokenize and other test modules.
|
||||||
|
@ -467,7 +467,7 @@ class GrammarTests(unittest.TestCase):
|
||||||
def test_var_annot_in_module(self):
|
def test_var_annot_in_module(self):
|
||||||
# check that functions fail the same way when executed
|
# check that functions fail the same way when executed
|
||||||
# outside of module where they were defined
|
# 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):
|
with self.assertRaises(NameError):
|
||||||
ann_module3.f_bad_ann()
|
ann_module3.f_bad_ann()
|
||||||
with self.assertRaises(NameError):
|
with self.assertRaises(NameError):
|
||||||
|
|
|
@ -4584,7 +4584,7 @@ class TestSignatureDefinitions(unittest.TestCase):
|
||||||
|
|
||||||
def test_base_class_have_text_signature(self):
|
def test_base_class_have_text_signature(self):
|
||||||
# see issue 43118
|
# see issue 43118
|
||||||
from test.ann_module7 import BufferedReader
|
from test.typinganndata.ann_module7 import BufferedReader
|
||||||
class MyBufferedReader(BufferedReader):
|
class MyBufferedReader(BufferedReader):
|
||||||
"""buffer reader class."""
|
"""buffer reader class."""
|
||||||
|
|
||||||
|
|
|
@ -324,7 +324,9 @@ a = A(destroyed)"""
|
||||||
del foo.__annotations__
|
del foo.__annotations__
|
||||||
|
|
||||||
def test_annotations_are_created_correctly(self):
|
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__)
|
self.assertTrue("__annotations__" in ann_module4.__dict__)
|
||||||
del ann_module4.__annotations__
|
del ann_module4.__annotations__
|
||||||
self.assertFalse("__annotations__" in ann_module4.__dict__)
|
self.assertFalse("__annotations__" in ann_module4.__dict__)
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
# Python test set -- part 2, opcodes
|
# Python test set -- part 2, opcodes
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
from test import ann_module, support
|
from test import support
|
||||||
|
from test.typinganndata import ann_module
|
||||||
|
|
||||||
class OpcodeTest(unittest.TestCase):
|
class OpcodeTest(unittest.TestCase):
|
||||||
|
|
||||||
|
|
|
@ -5306,7 +5306,7 @@ class AssertTypeTests(BaseTestCase):
|
||||||
|
|
||||||
|
|
||||||
# We need this to make sure that `@no_type_check` respects `__module__` attr:
|
# 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
|
@no_type_check
|
||||||
class NoTypeCheck_Outer:
|
class NoTypeCheck_Outer:
|
||||||
|
@ -5893,7 +5893,9 @@ class OverloadTests(BaseTestCase):
|
||||||
|
|
||||||
# Definitions needed for features introduced in Python 3.6
|
# 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')
|
T_a = TypeVar('T_a')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue