Commit fff85888 authored by Stefan Behnel's avatar Stefan Behnel

Provide more information when a test assertion fails.

parent 84c89789
......@@ -21,7 +21,7 @@ def test_record_subarray():
# Make sure the dtype looks like we expect
assert descr.fields == {'a': (py_numpy.dtype('int32'), 0),
'b': (py_numpy.dtype(('<f8', (3, 3))), 4)}
'b': (py_numpy.dtype(('<f8', (3, 3))), 4)}, descr.fields
# Make sure that HASSUBARRAY is working
assert not np.PyDataType_HASSUBARRAY(descr)
......@@ -29,9 +29,9 @@ def test_record_subarray():
assert np.PyDataType_HASSUBARRAY(b_descr)
# Make sure the direct field access works
assert <tuple>b_descr.subarray.shape == (3, 3)
assert <tuple>b_descr.subarray.shape == (3, 3), <tuple>b_descr.subarray.shape
# Make sure the safe high-level helper function works
assert np.PyDataType_SHAPE(descr) == ()
assert np.PyDataType_SHAPE(a_descr) == ()
assert np.PyDataType_SHAPE(b_descr) == (3, 3)
assert np.PyDataType_SHAPE(descr) == (), np.PyDataType_SHAPE(descr)
assert np.PyDataType_SHAPE(a_descr) == (), np.PyDataType_SHAPE(a_descr)
assert np.PyDataType_SHAPE(b_descr) == (3, 3), np.PyDataType_SHAPE(b_descr)
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