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

Method test_cannot_instantiate

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

Source from the content-addressed store, hash-verified

2368 self.assertIn(required_item, dir_items)
2369
2370 def test_cannot_instantiate(self):
2371 Callable = self.Callable
2372 with self.assertRaises(TypeError):
2373 Callable()
2374 with self.assertRaises(TypeError):
2375 type(Callable)()
2376 c = Callable[[int], str]
2377 with self.assertRaises(TypeError):
2378 c()
2379 with self.assertRaises(TypeError):
2380 type(c)()
2381
2382 def test_callable_wrong_forms(self):
2383 Callable = self.Callable

Callers

nothing calls this directly

Calls 3

CallableClass · 0.70
cClass · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected