mirror of
https://github.com/python/cpython.git
synced 2025-07-30 14:44:10 +00:00
bpo-46482: add a test for typing.Annotation.__new__
(GH-30821)
(cherry picked from commit 4c0612ad00
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
34794517d1
commit
6a188d88c5
1 changed files with 7 additions and 0 deletions
|
@ -4543,6 +4543,13 @@ class RETests(BaseTestCase):
|
|||
|
||||
class AnnotatedTests(BaseTestCase):
|
||||
|
||||
def test_new(self):
|
||||
with self.assertRaisesRegex(
|
||||
TypeError,
|
||||
'Type Annotated cannot be instantiated',
|
||||
):
|
||||
Annotated()
|
||||
|
||||
def test_repr(self):
|
||||
self.assertEqual(
|
||||
repr(Annotated[int, 4, 5]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue