Add make_some_type() to test_wip (reproduces Segmentation fault in test_class).

This commit is contained in:
Ralf W. Grosse-Kunstleve 2024-06-30 14:09:19 -07:00
parent 8fe75ff85b
commit c6a917eeae
2 changed files with 7 additions and 0 deletions

View File

@ -16,4 +16,6 @@ TEST_SUBMODULE(wip, m) {
py::class_<SomeType>(m, "SomeType").def(py::init([]() {
return std::unique_ptr<SomeType>(new SomeType);
}));
m.def("make_some_type", []() { return std::unique_ptr<SomeType>(new SomeType); });
}

View File

@ -10,3 +10,8 @@ def test_doc():
def test_some_type_ctor():
obj = m.SomeType()
assert isinstance(obj, m.SomeType)
def test_make_some_type():
obj = m.make_some_type()
assert isinstance(obj, m.SomeType)