Replace std::cout with py::print in tests

With this change both C++ and Python write to sys.stdout which resolves
the capture issues noted in #351. Therefore, the related workarounds are
removed.
This commit is contained in:
Dean Moldovan
2016-09-07 00:50:10 +02:00
parent c84b37b577
commit 81511be341
11 changed files with 51 additions and 64 deletions

View File

@@ -12,7 +12,7 @@
#include <pybind11/numpy.h>
double my_func(int x, float y, double z) {
std::cout << "my_func(x:int=" << x << ", y:float=" << y << ", z:float=" << z << ")" << std::endl;
py::print("my_func(x:int={}, y:float={:.0f}, z:float={:.0f})"_s.format(x, y, z));
return (float) x*y*z;
}