(self)
| 1080 | C() |
| 1081 | |
| 1082 | def test_post_init_staticmethod(self): |
| 1083 | flag = False |
| 1084 | @dataclass |
| 1085 | class C: |
| 1086 | x: int |
| 1087 | y: int |
| 1088 | @staticmethod |
| 1089 | def __post_init__(): |
| 1090 | nonlocal flag |
| 1091 | flag = True |
| 1092 | |
| 1093 | self.assertFalse(flag) |
| 1094 | c = C(3, 4) |
| 1095 | self.assertEqual((c.x, c.y), (3, 4)) |
| 1096 | self.assertTrue(flag) |
| 1097 | |
| 1098 | def test_post_init_classmethod(self): |
| 1099 | @dataclass |
nothing calls this directly
no test coverage detected