mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
Simplify more tests by replacing capture with assert
This commit is contained in:
@@ -27,18 +27,12 @@ py::object call_kw_func(py::function f) {
|
||||
return f(*args, **kwargs);
|
||||
}
|
||||
|
||||
void args_function(py::args args) {
|
||||
for (size_t it=0; it<args.size(); ++it)
|
||||
std::cout << "got argument: " << py::object(args[it]) << std::endl;
|
||||
py::tuple args_function(py::args args) {
|
||||
return args;
|
||||
}
|
||||
|
||||
void args_kwargs_function(py::args args, py::kwargs kwargs) {
|
||||
for (auto item : args)
|
||||
std::cout << "got argument: " << item << std::endl;
|
||||
if (kwargs) {
|
||||
for (auto item : kwargs)
|
||||
std::cout << "got keyword argument: " << item.first << " -> " << item.second << std::endl;
|
||||
}
|
||||
py::tuple args_kwargs_function(py::args args, py::kwargs kwargs) {
|
||||
return py::make_tuple(args, kwargs);
|
||||
}
|
||||
|
||||
struct KWClass {
|
||||
|
||||
Reference in New Issue
Block a user