Skip to content

Commit 56ca346

Browse files
committed
Fix test for changes to NumPy
Before: [[ 0. 0. 0. ] [ 0. 0. 0. ] [ 0. 0. 0. ]] With recent NumPy: [[0. 0. 0.] [0. 0. 0.] [0. 0. 0.]] See numpy/numpy#9139
1 parent 28c0f1c commit 56ca346

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/to-python.cc

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ BOOST_AUTO_TEST_CASE (redir)
3636
ToPython tp;
3737

3838
tp << "import numpy as np"
39+
<< "np.set_printoptions(formatter={'all': lambda x: str(x)})"
3940
<< "ar = np.zeros((3,3))"
4041
<< "print(ar)"
4142
<< "ar[0,1] = 42."

tests/to-python.stdout

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[[ 0. 0. 0.]
2-
[ 0. 0. 0.]
3-
[ 0. 0. 0.]]
1+
[[0.0 0.0 0.0]
2+
[0.0 0.0 0.0]
3+
[0.0 0.0 0.0]]
44
42.0

0 commit comments

Comments
 (0)