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

numpy-svn at scipy.org numpy-svn at scipy.org
Fri Nov 17 05:01:43 CST 2006


Author: stefan
Date: 2006-11-17 05:01:35 -0600 (Fri, 17 Nov 2006)
New Revision: 3442

Modified:
   trunk/numpy/core/tests/test_regression.py
Log:
Test for ticket #378.


Modified: trunk/numpy/core/tests/test_regression.py
===================================================================
--- trunk/numpy/core/tests/test_regression.py	2006-11-17 00:45:36 UTC (rev 3441)
+++ trunk/numpy/core/tests/test_regression.py	2006-11-17 11:01:35 UTC (rev 3442)
@@ -565,6 +565,24 @@
                   N.rec.fromarrays([(1,2),(3,4)],"i4,i4"),
                   N.rec.fromarrays([(1,2),(3,4)])]:
             assert_equal(a.dtype,dt)
+            
+    def check_refcount(self, level=rlevel):
+        """Ticket #378"""
+        import sys        
+        
+        a = N.arange(100*100).reshape([100,100])
+        b = a
+        
+        i = 1
+        
+        def p(x,y): return 123
+        v = N.vectorize(p)
+        
+        rc = sys.getrefcount(i)
+        for j in range(15):
+            d = v(a,b)
+        assert(sys.getrefcount(i) >= rc)
+        
 
 if __name__ == "__main__":
     NumpyTest().run()



More information about the Numpy-svn mailing list