diff options
author | David Cournapeau <cournape@gmail.com> | 2008-12-30 05:14:08 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-12-30 05:14:08 +0000 |
commit | 35e9bb436c7fcc73111384f079ac1b5d5b2ef3aa (patch) | |
tree | 20fc7af2048bbf9be90ed2bfe7ee509e6920b202 /numpy | |
parent | 31b6cdf83b48b7f6d7ee86f341bf7ed47b6d4a29 (diff) | |
parent | a4a94b1be5a8d195b0651ad1411b5c1a61cf54eb (diff) | |
download | numpy-35e9bb436c7fcc73111384f079ac1b5d5b2ef3aa.tar.gz |
Merged revisions 6251 via svnmerge from
http://svn.scipy.org/svn/numpy/trunk
........
r6251 | cdavid | 2008-12-30 14:12:50 +0900 (Tue, 30 Dec 2008) | 1 line
Use np.inf instead of float('inf'), as the later does not work on windows for python < 2.6.
........
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/tests/test_print.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/core/tests/test_print.py b/numpy/core/tests/test_print.py index efdd9b0d5..47d841a68 100644 --- a/numpy/core/tests/test_print.py +++ b/numpy/core/tests/test_print.py @@ -29,7 +29,7 @@ def test_float_types(): 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 @@ 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, '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_float_type_print(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(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: |