MCPcopy Index your code
hub / github.com/python/cpython / test_cannot_instantiate_forward

Method test_cannot_instantiate_forward

Lib/test/test_typing.py:9739–9742  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

9737 self.assertIsInstance(A(), C)
9738
9739 def test_cannot_instantiate_forward(self):
9740 A = Annotated["int", (5, 6)]
9741 with self.assertRaises(TypeError):
9742 A(5)
9743
9744 def test_cannot_instantiate_type_var(self):
9745 A = Annotated[T, (5, 6)]

Callers

nothing calls this directly

Calls 2

AClass · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected