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

Method test_small_dataclass

Lib/test/test_pprint.py:805–808  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

803 self.assertEqual(formatted, "MyDataclass()")
804
805 def test_small_dataclass(self):
806 dc = dataclass1("text", 123)
807 formatted = pprint.pformat(dc)
808 self.assertEqual(formatted, "dataclass1(field1='text', field2=123, field3=False)")
809
810 def test_larger_dataclass(self):
811 dc = dataclass1("some fairly long text", int(1e10), True)

Callers

nothing calls this directly

Calls 3

dataclass1Class · 0.85
pformatMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected