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

Method test_make_dataclass

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

Source from the content-addressed store, hash-verified

5195 d: int
5196
5197 def test_make_dataclass(self):
5198 A = make_dataclass("A", ['a'], kw_only=True)
5199 self.assertTrue(fields(A)[0].kw_only)
5200
5201 B = make_dataclass("B",
5202 ['a', ('b', int, field(kw_only=False))],
5203 kw_only=True)
5204 self.assertTrue(fields(B)[0].kw_only)
5205 self.assertFalse(fields(B)[1].kw_only)
5206
5207 def test_deferred_annotations(self):
5208 @dataclass

Callers

nothing calls this directly

Calls 5

make_dataclassFunction · 0.85
fieldsFunction · 0.85
fieldFunction · 0.85
assertTrueMethod · 0.80
assertFalseMethod · 0.80

Tested by

no test coverage detected