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

Method test_cannot_init

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

Source from the content-addressed store, hash-verified

2696 self.assertIn(required_item, dir_items)
2697
2698 def test_cannot_init(self):
2699 with self.assertRaises(TypeError):
2700 Literal()
2701 with self.assertRaises(TypeError):
2702 Literal[1]()
2703 with self.assertRaises(TypeError):
2704 type(Literal)()
2705 with self.assertRaises(TypeError):
2706 type(Literal[1])()
2707
2708 def test_no_isinstance_or_issubclass(self):
2709 with self.assertRaises(TypeError):

Callers

nothing calls this directly

Calls 2

LiteralFunction · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected