MCPcopy Index your code
hub / github.com/msgspec/msgspec / test_post_init_inheritance

Method test_post_init_inheritance

tests/unit/test_struct.py:2653–2665  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2651 Bad2()
2652
2653 def test_post_init_inheritance(self):
2654 called = False
2655
2656 class Base:
2657 def __post_init__(self):
2658 nonlocal called
2659 called = True
2660
2661 class Ex(Struct, Base):
2662 x: int
2663
2664 Ex(1)
2665 assert called
2666
2667 def test_post_init_not_called_on_copy(self):
2668 count = 0

Callers

nothing calls this directly

Calls 1

ExClass · 0.70

Tested by

no test coverage detected