diff options
author | David Cournapeau <cournape@gmail.com> | 2008-12-30 05:52:16 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-12-30 05:52:16 +0000 |
commit | 459125ba40852b2e4fa897500abbafad6390f692 (patch) | |
tree | 84f2fec5296f18fe2f3b499060fc6ed4cd370d78 /numpy | |
parent | 733feabcdba9aae2dbc1d71ec17c9b7483e68a1f (diff) | |
download | numpy-459125ba40852b2e4fa897500abbafad6390f692.tar.gz |
Fix some more redirected output print tests.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/tests/test_print.py | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/numpy/core/tests/test_print.py b/numpy/core/tests/test_print.py index 3afd4e450..9e9a417d6 100644 --- a/numpy/core/tests/test_print.py +++ b/numpy/core/tests/test_print.py @@ -100,30 +100,16 @@ def _test_redirected_print(x, tp): 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] : |