MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_cannot_instantiate

Method test_cannot_instantiate

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

Source from the content-addressed store, hash-verified

2365 self.assertIn(required_item, dir_items)
2366
2367 def test_cannot_instantiate(self):
2368 Callable = self.Callable
2369 with self.assertRaises(TypeError):
2370 Callable()
2371 with self.assertRaises(TypeError):
2372 type(Callable)()
2373 c = Callable[[int], str]
2374 with self.assertRaises(TypeError):
2375 c()
2376 with self.assertRaises(TypeError):
2377 type(c)()
2378
2379 def test_callable_wrong_forms(self):
2380 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