Remove all BAKEIN_BREAK in test_pickling.cpp,py (tests pass without any production code changes).

This commit is contained in:
Ralf W. Grosse-Kunstleve 2024-07-02 11:03:26 -07:00
parent c92b4d86da
commit f84be2e15a
2 changed files with 1 additions and 7 deletions

View File

@ -33,7 +33,6 @@ void wrap(py::module m) {
py::class_<SimpleBase, SimpleBaseTrampoline>(m, "SimpleBase")
.def(py::init<>())
.def_readwrite("num", &SimpleBase::num)
#ifdef BAKEIN_BREAK
.def(py::pickle(
[](const py::object &self) {
py::dict d;
@ -50,9 +49,7 @@ void wrap(py::module m) {
cpp_state->num = t[0].cast<int>();
auto py_state = t[1].cast<py::dict>();
return std::make_pair(std::move(cpp_state), py_state);
}))
#endif
;
}));
m.def("make_SimpleCppDerivedAsBase",
[]() { return std::unique_ptr<SimpleBase>(new SimpleCppDerived); });

View File

@ -53,7 +53,6 @@ def test_roundtrip_with_dict(cls_name):
def test_enum_pickle():
pytest.skip("BAKEIN_BREAK: ImportError")
from pybind11_tests import enums as e
data = pickle.dumps(e.EOne, 2)
@ -71,7 +70,6 @@ def test_roundtrip_simple_py_derived():
p = SimplePyDerived()
p.num = 202
p.stored_in_dict = 303
pytest.skip("BAKEIN_BREAK: TypeError: cannot pickle 'SimplePyDerived' object")
data = pickle.dumps(p, pickle.HIGHEST_PROTOCOL)
p2 = pickle.loads(data)
assert isinstance(p2, SimplePyDerived)
@ -80,7 +78,6 @@ def test_roundtrip_simple_py_derived():
def test_roundtrip_simple_cpp_derived():
pytest.skip("BAKEIN_BREAK: Segmentation fault")
p = m.make_SimpleCppDerivedAsBase()
assert m.check_dynamic_cast_SimpleCppDerived(p)
p.num = 404