()
| 76 | |
| 77 | |
| 78 | def test_pass_unique_ptr(): |
| 79 | obj = m.ToBeHeldByUniquePtr() |
| 80 | with pytest.raises(RuntimeError) as execinfo: |
| 81 | m.pass_unique_ptr(obj) |
| 82 | assert str(execinfo.value).startswith( |
| 83 | "Passing `std::unique_ptr<T>` from Python to C++ requires `py::class_<T, py::smart_holder>` (with T = " |
| 84 | ) |
| 85 | assert "ToBeHeldByUniquePtr" in str(execinfo.value) |
| 86 | |
| 87 | |
| 88 | def test_type(): |