[Numpy-svn] r8075 - trunk/numpy/core/tests

numpy-svn@scip... numpy-svn@scip...
Tue Jan 19 16:24:33 CST 2010


Author: oliphant
Date: 2010-01-19 16:24:33 -0600 (Tue, 19 Jan 2010)
New Revision: 8075

Modified:
   trunk/numpy/core/tests/test_multiarray.py
Log:
Fix test for sorting with other-endian field.

Modified: trunk/numpy/core/tests/test_multiarray.py
===================================================================
--- trunk/numpy/core/tests/test_multiarray.py	2010-01-19 18:58:18 UTC (rev 8074)
+++ trunk/numpy/core/tests/test_multiarray.py	2010-01-19 22:24:33 UTC (rev 8075)
@@ -414,11 +414,13 @@
             strtype = '>i2'
         else:
             strtype = '<i2'
+        mydtype = [('name', 'S5'),('col2',strtype)]
         r = np.array([('a', 1),('b', 255), ('c', 3), ('d', 258)],
-                     dtype=[('name', 'S5'),('col2',strtype)])
+                     dtype= mydtype)
         r.sort(order='col2')
         assert_equal(r['col2'], [1, 3, 255, 258])
-        assert_equal(r, [('a', 1), ('c', 3), ('b', 255), ('d', 258)])
+        assert_equal(r, np.array([('a', 1), ('c', 3), ('b', 255), ('d', 258)],
+                                 dtype=mydtype))
 
     def test_argsort(self):
         # all c scalar argsorts use the same code with different types



More information about the Numpy-svn mailing list