[Python-checkins] bpo-46482: add a test for `typing.Annotation.__new__` (GH-30821)
miss-islington
webhook-mailer at python.org
Tue Feb 1 05:27:41 EST 2022
https://github.com/python/cpython/commit/6a188d88c562bfd68ef3a32d148d9b234d50646e
commit: 6a188d88c562bfd68ef3a32d148d9b234d50646e
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-02-01T02:27:36-08:00
summary:
bpo-46482: add a test for `typing.Annotation.__new__` (GH-30821)
(cherry picked from commit 4c0612ad00ba45dbea2a86f7db6d21546cf243f8)
Co-authored-by: Nikita Sobolev <mail at sobolevn.me>
files:
M Lib/test/test_typing.py
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index e5b596e7f3d82..366f7d8eb31d1 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -4543,6 +4543,13 @@ class A(typing.Match):
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]),
More information about the Python-checkins
mailing list