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

numpy-svn@scip... numpy-svn@scip...
Mon Apr 30 03:53:29 CDT 2007


Author: stefan
Date: 2007-04-30 03:53:00 -0500 (Mon, 30 Apr 2007)
New Revision: 3730

Modified:
   trunk/numpy/core/tests/test_multiarray.py
   trunk/numpy/core/tests/test_regression.py
Log:
Add regression test.  Fix order of arguments in test_multiarray.


Modified: trunk/numpy/core/tests/test_multiarray.py
===================================================================
--- trunk/numpy/core/tests/test_multiarray.py	2007-04-27 20:37:55 UTC (rev 3729)
+++ trunk/numpy/core/tests/test_multiarray.py	2007-04-30 08:53:00 UTC (rev 3730)
@@ -380,7 +380,7 @@
                     byteorder = '='
 
                 if x.dtype.byteorder == '|': byteorder = '|'
-                assert_equal(byteorder,x.dtype.byteorder)
+                assert_equal(x.dtype.byteorder,byteorder)
                 self._check_range(x,expected_min,expected_max)
         return x
 

Modified: trunk/numpy/core/tests/test_regression.py
===================================================================
--- trunk/numpy/core/tests/test_regression.py	2007-04-27 20:37:55 UTC (rev 3729)
+++ trunk/numpy/core/tests/test_regression.py	2007-04-30 08:53:00 UTC (rev 3730)
@@ -645,5 +645,13 @@
         r = N.array([['abc']], dtype=[('var1', '|S20')])
         assert str(r['var1'][0][0]) == 'abc'
 
+    def check_take_output(self, level=rlevel):
+        """Ensure that 'take' honours output parameter."""
+        x = N.arange(12).reshape((3,4))
+        a = N.take(x,[0,2],axis=1)
+        b = N.zeros_like(a)
+        N.take(x,[0,2],axis=1,out=b)
+        assert_array_equal(a,b)
+
 if __name__ == "__main__":
     NumpyTest().run()



More information about the Numpy-svn mailing list