[Numpy-svn] r4980 - trunk/numpy/testing/tests

numpy-svn@scip... numpy-svn@scip...
Mon Apr 7 18:53:18 CDT 2008


Author: cdavid
Date: 2008-04-07 18:53:13 -0500 (Mon, 07 Apr 2008)
New Revision: 4980

Modified:
   trunk/numpy/testing/tests/test_utils.py
Log:
Test assert* funcs for arrays with Nan and rec arrays.

Modified: trunk/numpy/testing/tests/test_utils.py
===================================================================
--- trunk/numpy/testing/tests/test_utils.py	2008-04-07 23:18:47 UTC (rev 4979)
+++ trunk/numpy/testing/tests/test_utils.py	2008-04-07 23:53:13 UTC (rev 4980)
@@ -44,6 +44,13 @@
 
         self._test_not_equal(a, b)
 
+    def test_nan_array(self):
+        """Test two arrays with different shapes are found not equal."""
+        a = N.array([1, 2])
+        b = N.array([[1, 2], [1, 2]])
+
+        self._test_not_equal(a, b)
+
     def test_string_arrays(self):
         """Test two arrays with different shapes are found not equal."""
         a = N.array(['floupi', 'floupa'])
@@ -55,3 +62,18 @@
 
         self._test_not_equal(c, b)
 
+    def test_recarrays(self):
+        """Test record arrays."""
+        a = N.empty(2, [('floupi', N.float), ('floupa', N.float)])
+        a['floupi'] = [1, 2]
+        a['floupa'] = [1, 2]
+        b = a.copy()
+
+        self._test_equal(a, b)
+
+        c = N.empty(2, [('floupipi', N.float), ('floupa', N.float)])
+        c['floupipi'] = a['floupi'].copy()
+        c['floupa'] = a['floupa'].copy()
+
+        self._test_not_equal(c, b)
+



More information about the Numpy-svn mailing list