summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-12-30 05:12:50 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-12-30 05:12:50 +0000
commita4a94b1be5a8d195b0651ad1411b5c1a61cf54eb (patch)
treed1a19a9ce39c8cadadb2a3a62616b7cd7c469930 /numpy
parent60f262168aa7da060c5b172e5f75a411f3bb7d8b (diff)
downloadnumpy-a4a94b1be5a8d195b0651ad1411b5c1a61cf54eb.tar.gz
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.py8
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: