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

Method test_no_fields

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

Source from the content-addressed store, hash-verified

34
35class TestCase(unittest.TestCase):
36 def test_no_fields(self):
37 @dataclass
38 class C:
39 pass
40
41 o = C()
42 self.assertEqual(len(fields(C)), 0)
43
44 def test_no_fields_but_member_variable(self):
45 @dataclass

Callers

nothing calls this directly

Calls 3

assertEqualMethod · 0.95
fieldsFunction · 0.85
CClass · 0.70

Tested by

no test coverage detected