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

Method test_cannot_init

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

Source from the content-addressed store, hash-verified

9344 pass
9345
9346 def test_cannot_init(self):
9347 with self.assertRaises(TypeError):
9348 NotRequired()
9349 with self.assertRaises(TypeError):
9350 type(NotRequired)()
9351 with self.assertRaises(TypeError):
9352 type(NotRequired[Optional[int]])()
9353
9354 def test_no_isinstance(self):
9355 with self.assertRaises(TypeError):

Callers

nothing calls this directly

Calls 2

NotRequiredFunction · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected