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

numpy-svn at scipy.org numpy-svn at scipy.org
Sat Aug 12 16:57:08 CDT 2006


Author: stefan
Date: 2006-08-12 16:57:03 -0500 (Sat, 12 Aug 2006)
New Revision: 3001

Modified:
   trunk/numpy/core/tests/test_regression.py
Log:
Add test for object array creation.


Modified: trunk/numpy/core/tests/test_regression.py
===================================================================
--- trunk/numpy/core/tests/test_regression.py	2006-08-12 18:27:04 UTC (rev 3000)
+++ trunk/numpy/core/tests/test_regression.py	2006-08-12 21:57:03 UTC (rev 3001)
@@ -338,6 +338,15 @@
         x[0] = 'a   '
         x = x.rstrip()
         assert_equal(x[0], 'a')
+        
+    def check_object_array_shape(self,level=rlevel):
+        """Ticket #239"""
+        assert_equal(N.array([[1,2],3,4],dtype=object).shape, (3,))
+        assert_equal(N.array([[1,2],[3,4]],dtype=object).shape, (2,2))
+        #assert_equal(N.array([(1,2),(3,4)],dtype=object).shape, (2,))
+        assert_equal(N.array([],dtype=object).shape, ())
+        assert_equal(N.array([[],[],[]],dtype=object).shape, (3,))
+        assert_equal(N.array([[3,4],[5,6],None],dtype=object).shape, (3,))
 
 if __name__ == "__main__":
     NumpyTest().run()



More information about the Numpy-svn mailing list