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

Method test_class_var_no_default

Lib/test/test_dataclasses/__init__.py:1200–1206  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1198 self.assertEqual(c.s, 4000)
1199
1200 def test_class_var_no_default(self):
1201 # If a ClassVar has no default value, it should not be set on the class.
1202 @dataclass
1203 class C:
1204 x: ClassVar[int]
1205
1206 self.assertNotIn('x', C.__dict__)
1207
1208 def test_class_var_default_factory(self):
1209 # It makes no sense for a ClassVar to have a default factory. When

Callers

nothing calls this directly

Calls 1

assertNotInMethod · 0.95

Tested by

no test coverage detected