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

Function test_unique_ptr_cref_roundtrip

tests/test_class_sh_basic.py:168–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166
167
168def test_unique_ptr_cref_roundtrip():
169 # Multiple roundtrips to stress-test implementation.
170 num_round_trips = 1000
171 orig = m.atyp("passenger")
172 mtxt_orig = m.get_mtxt(orig)
173 recycled = orig
174 for _ in range(num_round_trips):
175 recycled = m.unique_ptr_cref_roundtrip(recycled)
176 assert recycled is orig
177 assert m.get_mtxt(recycled) == mtxt_orig
178
179
180@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

atypMethod · 0.80

Tested by

no test coverage detected