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

Method test_named_init_params

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

Source from the content-addressed store, hash-verified

123 self.assertHasAttr(Some.__dataclass_params__, param)
124
125 def test_named_init_params(self):
126 @dataclass
127 class C:
128 x: int
129
130 o = C(x=32)
131 self.assertEqual(o.x, 32)
132
133 def test_two_fields_one_default(self):
134 @dataclass

Callers

nothing calls this directly

Calls 2

assertEqualMethod · 0.95
CClass · 0.70

Tested by

no test coverage detected