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

Method test_cannot_init

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

LiteralFunction · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected