Fixed bad_arg_def imports

Don't try to define these in the issues submodule, because that fails
if testing without issues compiled in (e.g. using
cmake -DPYBIND11_TEST_OVERRIDE=test_methods_and_attributes.cpp).
This commit is contained in:
Jason Rhinelander 2017-04-15 11:12:41 -04:00
parent 02ffbf16fe
commit 2d14c1c5db

View File

@ -299,11 +299,11 @@ test_initializer methods_and_attributes([](py::module &m) {
m.attr("debug_enabled") = false; m.attr("debug_enabled") = false;
#endif #endif
m.def("bad_arg_def_named", []{ m.def("bad_arg_def_named", []{
auto m = py::module::import("pybind11_tests.issues"); auto m = py::module::import("pybind11_tests");
m.def("should_fail", [](int, NotRegistered) {}, py::arg(), py::arg("a") = NotRegistered()); m.def("should_fail", [](int, NotRegistered) {}, py::arg(), py::arg("a") = NotRegistered());
}); });
m.def("bad_arg_def_unnamed", []{ m.def("bad_arg_def_unnamed", []{
auto m = py::module::import("pybind11_tests.issues"); auto m = py::module::import("pybind11_tests");
m.def("should_fail", [](int, NotRegistered) {}, py::arg(), py::arg() = NotRegistered()); m.def("should_fail", [](int, NotRegistered) {}, py::arg(), py::arg() = NotRegistered());
}); });
}); });