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

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Apr 7 19:59:19 EDT 2008


Author: cdavid
Date: 2008-04-07 18:59:17 -0500 (Mon, 07 Apr 2008)
New Revision: 4982

Modified:
   trunk/numpy/testing/tests/test_utils.py
Log:
assert* funcs: Add generic test for rank 3 arrays.

Modified: trunk/numpy/testing/tests/test_utils.py
===================================================================
--- trunk/numpy/testing/tests/test_utils.py	2008-04-07 23:57:42 UTC (rev 4981)
+++ trunk/numpy/testing/tests/test_utils.py	2008-04-07 23:59:17 UTC (rev 4982)
@@ -95,3 +95,22 @@
         # Test strings
         for t in ['S1', 'U1']:
             foo(t)
+
+    def test_generic_rank3(self):
+        """Test rank 3 array for all dtypes."""
+        def foo(t):
+            a = N.empty((4, 2, 3), t)
+            a.fill(1)
+            b = a.copy()
+            c = a.copy()
+            c.fill(0)
+            self._test_equal(a, b)
+            self._test_not_equal(c, b)
+
+        # Test numeric types and object
+        for t in '?bhilqpBHILQPfdgFDG':
+            foo(t)
+
+        # Test strings
+        for t in ['S1', 'U1']:
+            foo(t)




More information about the Numpy-svn mailing list