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

Function test_unique_nodelete

tests/test_smart_ptr.py:125–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

123
124@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")
125def test_unique_nodelete():
126 o = m.MyObject4(23)
127 assert o.value == 23
128 cstats = ConstructorStats.get(m.MyObject4)
129 assert cstats.alive() == 1
130 del o
131 assert cstats.alive() == 1
132 m.MyObject4.cleanup_all_instances()
133 assert cstats.alive() == 0
134
135
136@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")

Callers

nothing calls this directly

Calls 3

MyObject4Method · 0.80
aliveMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected