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

Method test_replace_gc_false

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

Source from the content-addressed store, hash-verified

2342 assert not gc.is_tracked(replace(obj, y=None))
2343
2344 def test_replace_gc_false(self, replace):
2345 class Test(msgspec.Struct, gc=False):
2346 x: int
2347 y: List[int]
2348
2349 res = replace(Test(1, [1, 2]), x=3)
2350 assert res == Test(3, [1, 2])
2351 assert not gc.is_tracked(res)
2352
2353 def test_replace_reference_counts(self, replace):
2354 class Test(msgspec.Struct):

Callers

nothing calls this directly

Calls 2

replaceFunction · 0.85
TestClass · 0.70

Tested by

no test coverage detected