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

numpy-svn@scip... numpy-svn@scip...
Sat Apr 19 21:45:48 CDT 2008


Author: charris
Date: 2008-04-19 21:45:19 -0500 (Sat, 19 Apr 2008)
New Revision: 5053

Modified:
   trunk/numpy/core/tests/test_ufunc.py
Log:
Make the object loops tests less susceptiple to reference counting errors.
The tests are still counting errors, and I may change these back when they
are fixed.


Modified: trunk/numpy/core/tests/test_ufunc.py
===================================================================
--- trunk/numpy/core/tests/test_ufunc.py	2008-04-20 02:42:23 UTC (rev 5052)
+++ trunk/numpy/core/tests/test_ufunc.py	2008-04-20 02:45:19 UTC (rev 5053)
@@ -81,7 +81,7 @@
         msg = "PyUFunc_G_G"
         x = np.zeros(10, dtype=np.clongdouble)[0::2]
         assert_almost_equal(fone(x), fone_val, err_msg=msg)
- 
+
         # check binary PyUFunc_ff_f.
         msg = "PyUFunc_ff_f"
         x = np.ones(10, dtype=np.single)[0::2]
@@ -106,14 +106,14 @@
         msg = "PyUFunc_GG_G"
         x = np.ones(10, dtype=np.clongdouble)[0::2]
         assert_almost_equal(ftwo(x,x), ftwo_val, err_msg=msg)
- 
+
         # class to use in testing object method loops
         class foo :
             def logical_not(self) :
                 return np.bool_(1)
             def logical_and(self, obj) :
                 return np.bool_(1)
- 
+
         # check unary PyUFunc_O_0
         msg = "PyUFunc_O_O"
         x = np.ones(10, dtype=np.object)[0::2]
@@ -121,9 +121,10 @@
         # check unary PyUFunc_O_0_method
         msg = "PyUFunc_O_O_method"
         x = np.zeros(10, dtype=np.object)[0::2]
-        x[...] = foo()
+        for i in range(len(x)) :
+            x[i] = foo()
         #assert np.all(np.logical_not(x) == True), msg
- 
+
         # check binary PyUFunc_OO_0
         msg = "PyUFunc_OO_O"
         x = np.ones(10, dtype=np.object)[0::2]
@@ -131,9 +132,10 @@
         # check binary PyUFunc_OO_0_method
         msg = "PyUFunc_OO_O_method"
         x = np.zeros(10, dtype=np.object)[0::2]
-        x[...] = foo()
+        for i in range(len(x)) :
+            x[i] = foo()
         #assert np.all(np.logical_and(x,x) == 1), msg
- 
+
         # check PyUFunc_On_Om
         # fixme -- I don't know how to do this yet
 



More information about the Numpy-svn mailing list