Skip to content

Commit ba9cacf

Browse files
committed
Fix numpy dtypes test on big-endian architectures
This fixes the test code on big-endian architectures: the array support (PR #832) had hard-coded the little-endian '<' but we need to use '>' on big-endian architectures.
1 parent 2d0507d commit ba9cacf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_numpy_dtypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_dtype(simple_dtype):
103103
partial_nested_fmt(),
104104
"[('a', 'S3'), ('b', 'S3')]",
105105
("{{'names':['a','b','c','d'], " +
106-
"'formats':[('S4', (3,)),('<i4', (2,)),('u1', (3,)),('<f4', (4, 2))], " +
106+
"'formats':[('S4', (3,)),('"+e+"i4', (2,)),('u1', (3,)),('"+e+"f4', (4, 2))], " +
107107
"'offsets':[0,12,20,24], 'itemsize':56}}").format(e=e),
108108
"[('e1', '" + e + "i8'), ('e2', 'u1')]",
109109
"[('x', 'i1'), ('y', '" + e + "u8')]",
@@ -215,7 +215,7 @@ def test_array_array():
215215
arr = m.create_array_array(3)
216216
assert str(arr.dtype) == (
217217
"{{'names':['a','b','c','d'], " +
218-
"'formats':[('S4', (3,)),('<i4', (2,)),('u1', (3,)),('{e}f4', (4, 2))], " +
218+
"'formats':[('S4', (3,)),('"+e+"i4', (2,)),('u1', (3,)),('{e}f4', (4, 2))], " +
219219
"'offsets':[0,12,20,24], 'itemsize':56}}").format(e=e)
220220
assert m.print_array_array(arr) == [
221221
"a={{A,B,C,D},{K,L,M,N},{U,V,W,X}},b={0,1}," +

0 commit comments

Comments
 (0)