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

Method test_cannot_init

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

Source from the content-addressed store, hash-verified

6007 pass
6008
6009 def test_cannot_init(self):
6010 with self.assertRaises(TypeError):
6011 ClassVar()
6012 with self.assertRaises(TypeError):
6013 type(ClassVar)()
6014 with self.assertRaises(TypeError):
6015 type(ClassVar[Optional[int]])()
6016
6017 def test_no_isinstance(self):
6018 with self.assertRaises(TypeError):

Callers

nothing calls this directly

Calls 2

ClassVarFunction · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected