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

Method test_replace_calls_post_init

tests/unit/test_struct.py:2382–2394  ·  view source on GitHub ↗
(self, replace)

Source from the content-addressed store, hash-verified

2380 del t2
2381
2382 def test_replace_calls_post_init(self, replace):
2383 count = 0
2384
2385 class Ex(Struct):
2386 def __post_init__(self):
2387 nonlocal count
2388 count += 1
2389
2390 x1 = Ex()
2391 assert count == 1
2392 x2 = replace(x1)
2393 assert x1 == x2
2394 assert count == 2
2395
2396
2397class TestAsDictAndAsTuple:

Callers

nothing calls this directly

Calls 2

replaceFunction · 0.85
ExClass · 0.70

Tested by

no test coverage detected