Commit c0d606ac authored by Stefan Behnel's avatar Stefan Behnel

make doctest output readable on error

parent 836525ff
# tag: numpy
# mode: run # mode: run
# tag: numpy
""" """
Test accepting NumPy arrays with arbitrary strides for zero- or one-sized Test accepting NumPy arrays with arbitrary strides for zero- or one-sized
...@@ -28,8 +28,8 @@ import numpy as np ...@@ -28,8 +28,8 @@ import numpy as np
def test_one_sized(array): def test_one_sized(array):
""" """
>>> a = np.ascontiguousarray(np.arange(10, dtype=np.double)[::100]) >>> contig = np.ascontiguousarray(np.arange(10, dtype=np.double)[::100])
>>> test_one_sized(a)[0] >>> test_one_sized(contig)[0]
1.0 1.0
>>> a = np.arange(10, dtype=np.double)[::100] >>> a = np.arange(10, dtype=np.double)[::100]
>>> test_one_sized(a)[0] >>> test_one_sized(a)[0]
...@@ -41,10 +41,11 @@ def test_one_sized(array): ...@@ -41,10 +41,11 @@ def test_one_sized(array):
def test_zero_sized(array): def test_zero_sized(array):
""" """
>>> a = np.ascontiguousarray(np.arange(10, dtype=np.double)[100:200:10]) >>> contig = np.ascontiguousarray(np.arange(10, dtype=np.double)[100:200:10])
>>> a = test_zero_sized(a) >>> _ = test_zero_sized(contig)
>>> a = np.arange(10, dtype=np.double)[100:200:10] >>> a = np.arange(10, dtype=np.double)[100:200:10]
>>> a = test_zero_sized(a) >>> _ = test_zero_sized(a)
""" """
cdef double[::1] a = array cdef double[::1] a = array
return a return a
\ No newline at end of file
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