MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_shared_ptr_gc

Function test_shared_ptr_gc

tests/test_smart_ptr.py:334–341  ·  view source on GitHub ↗

#187: issue involving std::shared_ptr<> return value policy & garbage collection

()

Source from the content-addressed store, hash-verified

332
333
334def test_shared_ptr_gc():
335 """#187: issue involving std::shared_ptr<> return value policy & garbage collection"""
336 el = m.ElementList()
337 for i in range(10):
338 el.add(m.ElementA(i))
339 pytest.gc_collect()
340 for i, v in enumerate(el.get()):
341 assert i == v.value()
342
343
344def test_private_esft_tolerance():

Callers

nothing calls this directly

Calls 4

addMethod · 0.95
ElementAMethod · 0.80
getMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected