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

Method test_one_field_no_default

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

Source from the content-addressed store, hash-verified

50 self.assertEqual(len(fields(C)), 0)
51
52 def test_one_field_no_default(self):
53 @dataclass
54 class C:
55 x: int
56
57 o = C(42)
58 self.assertEqual(o.x, 42)
59
60 def test_field_default_default_factory_error(self):
61 msg = "cannot specify both default and default_factory"

Callers

nothing calls this directly

Calls 2

assertEqualMethod · 0.95
CClass · 0.70

Tested by

no test coverage detected