[Numpy-svn] r6332 - trunk/numpy/lib/tests

numpy-svn@scip... numpy-svn@scip...
Thu Jan 22 12:21:35 CST 2009


Author: pierregm
Date: 2009-01-22 12:21:32 -0600 (Thu, 22 Jan 2009)
New Revision: 6332

Modified:
   trunk/numpy/lib/tests/test_recfunctions.py
Log:
* fixed a machine-dependent issue on default int ('<i4' on OS X, '<i8' on linux) ?
* fixed an machine-dependent issue on argsort ?

Modified: trunk/numpy/lib/tests/test_recfunctions.py
===================================================================
--- trunk/numpy/lib/tests/test_recfunctions.py	2009-01-22 05:40:25 UTC (rev 6331)
+++ trunk/numpy/lib/tests/test_recfunctions.py	2009-01-22 18:21:32 UTC (rev 6332)
@@ -31,27 +31,27 @@
         # Std array
         test = zip_descr((x, x), flatten=True)
         assert_equal(test,
-                     np.dtype([('', '<i4'), ('', '<i4')]))
+                     np.dtype([('', int), ('', int)]))
         test = zip_descr((x, x), flatten=False)
         assert_equal(test,
-                     np.dtype([('', '<i4'), ('', '<i4')]))
+                     np.dtype([('', int), ('', int)]))
         # Std & flexible-dtype 
         test = zip_descr((x, z), flatten=True)
         assert_equal(test,
-                     np.dtype([('', '<i4'), ('A', '|S3'), ('B', float)]))
+                     np.dtype([('', int), ('A', '|S3'), ('B', float)]))
         test = zip_descr((x, z), flatten=False)
         assert_equal(test, 
-                     np.dtype([('', '<i4'),
+                     np.dtype([('', int),
                                ('', [('A', '|S3'), ('B', float)])]))
         # Standard & nested dtype 
         test = zip_descr((x, w), flatten=True)
         assert_equal(test,
-                     np.dtype([('', '<i4'),
+                     np.dtype([('', int),
                                ('a', int),
                                ('ba', float), ('bb', int)]))
         test = zip_descr((x, w), flatten=False)
         assert_equal(test,
-                     np.dtype([('', '<i4'),
+                     np.dtype([('', int),
                                ('', [('a', int),
                                      ('b', [('ba', float), ('bb', int)])])]))
 
@@ -183,7 +183,10 @@
         #
         test = find_duplicates(a, ignoremask=False, return_index=True)
         control = [0, 1, 3, 4, 6, 2]
-        assert_equal(test[-1], control)
+        try:
+            assert_equal(test[-1], control)
+        except AssertionError:
+            assert_equal(test[-1], [0, 1, 3, 4, 2, 6])
         assert_equal(test[0], a[control])
 
 



More information about the Numpy-svn mailing list