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

Function test_pass_unique_ptr_disowns

tests/test_class_sh_basic.py:108–117  ·  view source on GitHub ↗
(pass_f, rtrn_f, expected)

Source from the content-addressed store, hash-verified

106 ],
107)
108def test_pass_unique_ptr_disowns(pass_f, rtrn_f, expected):
109 obj = rtrn_f()
110 assert pass_f(obj) == expected
111 with pytest.raises(ValueError) as exc_info:
112 pass_f(obj)
113 assert str(exc_info.value) == (
114 "Missing value for wrapped C++ type"
115 " `pybind11_tests::class_sh_basic::atyp`:"
116 " Python instance was disowned."
117 )
118
119
120@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

strClass · 0.85

Tested by

no test coverage detected