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

Method test_post_init_not_called_on_copy

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

Source from the content-addressed store, hash-verified

2665 assert called
2666
2667 def test_post_init_not_called_on_copy(self):
2668 count = 0
2669
2670 class Ex(Struct):
2671 def __post_init__(self):
2672 nonlocal count
2673 count += 1
2674
2675 x1 = Ex()
2676 assert count == 1
2677 x2 = x1.__copy__()
2678 assert x1 == x2
2679 assert count == 1

Callers

nothing calls this directly

Calls 1

ExClass · 0.70

Tested by

no test coverage detected