summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2022-02-01 09:58:41 (GMT)
committerGitHub <noreply@github.com>2022-02-01 09:58:41 (GMT)
commit4c0612ad00ba45dbea2a86f7db6d21546cf243f8 (patch)
treeb3dfce1b439422aaa4a20284e8fc30a4483f5966 /Lib
parentee0ac328d38a86f7907598c94cb88a97635b32f8 (diff)
downloadcpython-4c0612ad00ba45dbea2a86f7db6d21546cf243f8.zip
cpython-4c0612ad00ba45dbea2a86f7db6d21546cf243f8.tar.gz
cpython-4c0612ad00ba45dbea2a86f7db6d21546cf243f8.tar.bz2
bpo-46482: add a test for `typing.Annotation.__new__` (GH-30821)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_typing.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 8449aff..090d4c7 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -4643,6 +4643,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]),