Commit 56f03d35 authored by Stefan Behnel's avatar Stefan Behnel

Fix doctest issue due to different array display in NumPy 1.14.

parent 784722da
...@@ -43,14 +43,14 @@ try: ...@@ -43,14 +43,14 @@ try:
2 0 9 5 2 0 9 5
>>> three_dim() # doctest: +NORMALIZE_WHITESPACE >>> three_dim() # doctest: +NORMALIZE_WHITESPACE
[[[ 0. 1. 2. 3.] [[[0. 1. 2. 3.]
[ 4. 5. 6. 7.]] [4. 5. 6. 7.]]
<_BLANKLINE_> <BLANKLINE>
[[ 8. 9. 10. 11.] [[8. 9. 10. 11.]
[ 12. 13. 14. 15.]] [12. 13. 14. 15.]]
<_BLANKLINE_> <BLANKLINE>
[[ 16. 17. 18. 19.] [[16. 17. 18. 19.]
[ 20. 21. 22. 23.]]] [20. 21. 22. 23.]]]
6.0 0.0 13.0 8.0 6.0 0.0 13.0 8.0
>>> obj_array() >>> obj_array()
...@@ -286,10 +286,9 @@ def assert_dtype_sizes(): ...@@ -286,10 +286,9 @@ def assert_dtype_sizes():
def ndarray_str(arr): def ndarray_str(arr):
u""" u"""
Since Py2.3 doctest don't support <BLANKLINE>, manually replace blank lines Work around display differences in NumPy 1.14.
with <_BLANKLINE_>
""" """
return unicode(arr).replace(u'\n\n', u'\n<_BLANKLINE_>\n') return re.sub(ur'\[ +', '[', unicode(arr))
def basic(): def basic():
cdef object[int, ndim=2] buf = np.arange(10, dtype='i').reshape((2, 5)) cdef object[int, ndim=2] buf = np.arange(10, dtype='i').reshape((2, 5))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment