| 86 | |
| 87 | template <typename F> |
| 88 | void ignoreOldStyleInitWarnings(F &&body) { |
| 89 | py::exec(R"( |
| 90 | message = "pybind11-bound class '.+' is using an old-style placement-new '(?:__init__|__setstate__)' which has been deprecated" |
| 91 | |
| 92 | import warnings |
| 93 | with warnings.catch_warnings(): |
| 94 | warnings.filterwarnings("ignore", message=message, category=FutureWarning) |
| 95 | body() |
| 96 | )", |
| 97 | py::dict(py::arg("body") = py::cpp_function(body))); |
| 98 | } |
| 99 | |
| 100 | // See PR #5419 for background. |
| 101 | class TestContext { |
no test coverage detected