Commit fcd59a76 authored by Pauli Virtanen's avatar Pauli Virtanen Committed by Dag Sverre Seljebotn

TST: numpy_test: run some of the buffer tests only when a sufficiently new...

TST: numpy_test: run some of the buffer tests only when a sufficiently new Numpy version is available
parent ee0cf002
...@@ -193,6 +193,26 @@ try: ...@@ -193,6 +193,26 @@ try:
ValueError: ... ValueError: ...
>>> test_good_cast()
True
>>> test_bad_cast()
Traceback (most recent call last):
...
ValueError: Item size of buffer (1 byte) does not match size of 'int' (4 bytes)
>>> test_complextypes()
1,1
1,1
8,16
>>> test_point_record()
array([(0.0, 0.0), (1.0, -1.0), (2.0, -2.0)],
dtype=[('x', '!f8'), ('y', '!f8')])
"""
if np.__version__ >= '1.6':
__doc__ += u"""
The following expose bugs in Numpy (versions prior to 2011-04-02): The following expose bugs in Numpy (versions prior to 2011-04-02):
>>> print(test_partially_packed_align(np.zeros((1,), dtype=np.dtype([('a', 'b'), ('b', 'i'), ('sub', np.dtype('b,i')), ('c', 'i')], align=True)))) >>> print(test_partially_packed_align(np.zeros((1,), dtype=np.dtype([('a', 'b'), ('b', 'i'), ('sub', np.dtype('b,i')), ('c', 'i')], align=True))))
...@@ -212,25 +232,8 @@ try: ...@@ -212,25 +232,8 @@ try:
Traceback (most recent call last): Traceback (most recent call last):
... ...
ValueError: ... ValueError: ...
"""
>>> test_good_cast()
True
>>> test_bad_cast()
Traceback (most recent call last):
...
ValueError: Item size of buffer (1 byte) does not match size of 'int' (4 bytes)
>>> test_complextypes()
1,1
1,1
8,16
>>> test_point_record()
array([(0.0, 0.0), (1.0, -1.0), (2.0, -2.0)],
dtype=[('x', '!f8'), ('y', '!f8')])
"""
except: except:
__doc__ = u"" __doc__ = u""
......
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