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

Function test_move_only_holder

tests/test_smart_ptr.py:268–276  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

266
267@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")
268def test_move_only_holder():
269 a = m.TypeWithMoveOnlyHolder.make()
270 b = m.TypeWithMoveOnlyHolder.make_as_object()
271 stats = ConstructorStats.get(m.TypeWithMoveOnlyHolder)
272 assert stats.alive() == 2
273 del b
274 assert stats.alive() == 1
275 del a
276 assert stats.alive() == 0
277
278
279@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")

Callers

nothing calls this directly

Calls 3

aliveMethod · 0.80
makeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected