[Numpy-svn] r4018 - in trunk/numpy: core/tests testing

numpy-svn at scipy.org numpy-svn at scipy.org
Tue Aug 28 18:19:56 EDT 2007


Author: stefan
Date: 2007-08-28 17:19:35 -0500 (Tue, 28 Aug 2007)
New Revision: 4018

Modified:
   trunk/numpy/core/tests/test_multiarray.py
   trunk/numpy/testing/parametric.py
Log:
Replace generator expressions for compatibility with Python 2.3.


Modified: trunk/numpy/core/tests/test_multiarray.py
===================================================================
--- trunk/numpy/core/tests/test_multiarray.py	2007-08-28 17:26:43 UTC (rev 4017)
+++ trunk/numpy/core/tests/test_multiarray.py	2007-08-28 22:19:35 UTC (rev 4018)
@@ -449,7 +449,7 @@
         assert_array_equal(x,[-1,2,-1])
 
     def testip_byteorder(self):
-        return ((self.tst_byteorder,dtype) for dtype in ('>i4','<i4'))
+        return [(self.tst_byteorder,dtype) for dtype in ('>i4','<i4')]
 
     def test_record_array(self):
         # Note mixed byteorder.

Modified: trunk/numpy/testing/parametric.py
===================================================================
--- trunk/numpy/testing/parametric.py	2007-08-28 17:26:43 UTC (rev 4017)
+++ trunk/numpy/testing/parametric.py	2007-08-28 22:19:35 UTC (rev 4018)
@@ -262,11 +262,11 @@
             You must return an iterable (list or generator is fine) containing
             tuples with the actual method to be called as the first argument,
             and the arguments for that call later."""
-            return ((self.tstX,i) for i in range(5))
+            return [(self.tstX,i) for i in range(5)]
 
         def testip2(self):
             """Another independent parametric test factory"""
-            return ((self.tstY,i) for i in range(5))
+            return [(self.tstY,i) for i in range(5)]
 
         def testip3(self):
             """Test factory combining different subtests.
@@ -281,11 +281,11 @@
             A single setUp() call is made for all the tests returned by this
             method.
             """
-            return ((self.tstXX,i,i+1) for i in range(5))
+            return [(self.tstXX,i,i+1) for i in range(5)]
 
         def testsp2(self):
             """Another shared parametric test factory"""
-            return ((self.tstYY,i) for i in range(5))
+            return [(self.tstYY,i) for i in range(5)]
 
         def testsp3(self):
             """Another shared parametric test factory.
@@ -293,7 +293,7 @@
             This one simply calls the same test multiple times, without any
             arguments.  Note that you must still return tuples, even if there
             are no arguments."""
-            return ((self.tstZZ,) for i in range(10))
+            return [(self.tstZZ,) for i in range(10)]
 
 
     # This test class runs normally under unittest's default runner




More information about the Numpy-svn mailing list