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

numpy-svn@scip... numpy-svn@scip...
Mon Dec 29 23:52:21 CST 2008


Author: cdavid
Date: 2008-12-29 23:52:16 -0600 (Mon, 29 Dec 2008)
New Revision: 6261

Modified:
   trunk/numpy/core/tests/test_print.py
Log:
Fix some more redirected output print tests.

Modified: trunk/numpy/core/tests/test_print.py
===================================================================
--- trunk/numpy/core/tests/test_print.py	2008-12-30 05:50:18 UTC (rev 6260)
+++ trunk/numpy/core/tests/test_print.py	2008-12-30 05:52:16 UTC (rev 6261)
@@ -100,30 +100,16 @@
                  err_msg='print failed for type%s' % tp)
 
 def check_float_type_print(tp):
-    for x in [0, 1,-1, 1e20, np.inf, -np.inf, np.nan]:
+    for x in [0, 1,-1, 1e10, 1e20, np.inf, -np.inf, np.nan]:
         _test_redirected_print(float(x), tp)
 
-    if tp(1e10).itemsize > 4:
-        assert_equal(str(tp(1e10)), str(float(1e10)),
-                     err_msg='Failed str formatting for type %s' % tp)
-    else:
-        assert_equal(str(tp(1e10)), '1e+10',
-                     err_msg='Failed str formatting for type %s' % tp)
-
 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(np.inf, 1),
+    for x in [0, 1, -1, 1e10, 1e20, complex(np.inf, 1),
               complex(np.nan, 1), complex(-np.inf, 1)] :
         _test_redirected_print(complex(x), tp)
 
-    if tp(1e10).itemsize > 8:
-        assert_equal(str(tp(1e10)), str(complex(1e10)),
-                     err_msg='Failed str formatting for type %s' % tp)
-    else:
-        assert_equal(str(tp(1e10)), '(1e+10+0j)',
-                     err_msg='Failed str formatting for type %s' % tp)
-
 def test_float_type_print():
     """Check formatting when using print """
     for t in [np.float32, np.double, np.longdouble] :



More information about the Numpy-svn mailing list