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

numpy-svn at scipy.org numpy-svn at scipy.org
Tue Dec 30 00:12:53 EST 2008


Author: cdavid
Date: 2008-12-29 23:12:50 -0600 (Mon, 29 Dec 2008)
New Revision: 6251

Modified:
   trunk/numpy/core/tests/test_print.py
Log:
Use np.inf instead of float('inf'), as the later does not work on windows for python < 2.6.

Modified: trunk/numpy/core/tests/test_print.py
===================================================================
--- trunk/numpy/core/tests/test_print.py	2008-12-30 05:02:28 UTC (rev 6250)
+++ trunk/numpy/core/tests/test_print.py	2008-12-30 05:12:50 UTC (rev 6251)
@@ -29,7 +29,7 @@
         yield check_float_type, t
 
 def check_nan_inf_float(tp):
-    for x in [float('inf'), float('-inf'), float('nan')]:
+    for x in [np.inf, -np.inf, np.nan]:
         assert_equal(str(tp(x)), str(float(x)),
                      err_msg='Failed str formatting for type %s' % tp)
 
@@ -88,7 +88,7 @@
                  err_msg='print failed for type%s' % tp)
 
 def check_float_type_print(tp):
-    for x in [0, 1,-1, 1e20, 'inf', 'nan', '-inf'] :
+    for x in [0, 1,-1, 1e20, np.inf, -np.inf, np.nan]
         _test_redirected_print(float(x), tp)
 
     if tp(1e10).itemsize > 4:
@@ -101,8 +101,8 @@
 def check_complex_type_print(tp):
     # We do not create complex with inf/nan directly because the feature is
     # missing in python < 2.6
-    for x in [0, 1, -1, 1e20, complex(float('inf'), 1),
-              complex(float('nan'), 1), complex(float('-inf'), 1)] :
+    for x in [0, 1, -1, 1e20, complex(np.inf, 1),
+              complex(np.nan, 1), complex(-np.inf, 1)] :
         _test_redirected_print(complex(x), tp)
 
     if tp(1e10).itemsize > 8:




More information about the Numpy-svn mailing list