summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-12-30 06:03:04 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-12-30 06:03:04 +0000
commit27b0df0424f062c9d944fede7977640fb5a2fced (patch)
treeb161607846f3b5987a3b7db5b1f0c4a7462a257d
parent29326721164c082afbec863d91e0f17a68d4f97d (diff)
parentddf0d0dee18eab8c8e30f9809c38fa641b9afaa8 (diff)
downloadnumpy-27b0df0424f062c9d944fede7977640fb5a2fced.tar.gz
Merged revisions 6263 via svnmerge from
http://svn.scipy.org/svn/numpy/trunk ........ r6263 | cdavid | 2008-12-30 15:01:31 +0900 (Tue, 30 Dec 2008) | 1 line More fixes for print tests. ........
-rw-r--r--numpy/core/tests/test_print.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/numpy/core/tests/test_print.py b/numpy/core/tests/test_print.py
index 9e9a417d6..d18b63897 100644
--- a/numpy/core/tests/test_print.py
+++ b/numpy/core/tests/test_print.py
@@ -5,9 +5,17 @@ import locale
import sys
from StringIO import StringIO
-_REF = {np.inf: 'inf', -np.inf: '-inf', np.nan: 'nan', complex(np.inf, 1):
- '(inf+1j)', complex(np.nan, 1): '(nan+1j)', complex(-np.inf, 1):
- '(-inf+1j)'}
+_REF = {np.inf: 'inf', -np.inf: '-inf', np.nan: 'nan',
+ np.complex64(np.inf, 1): '(inf+1j)',
+ np.complex64(np.nan, 1): '(nan+1j)',
+ np.complex64(-np.inf, 1): '(-inf+1j)'
+ np.cdouble(np.inf, 1): '(inf+1j)',
+ np.cdouble(np.nan, 1): '(nan+1j)',
+ np.cdouble(-np.inf, 1): '(-inf+1j)'
+ np.clongdouble(np.inf, 1): '(inf+1j)',
+ np.clongdouble(np.nan, 1): '(nan+1j)',
+ np.clongdouble(-np.inf, 1): '(-inf+1j)'
+ }
if sys.platform == 'win32' and sys.version_info[0] <= 2 and sys.version_info[1] <= 5:
_REF[np.float32(1e10)] = '1e+010'
@@ -89,8 +97,8 @@ def _test_redirected_print(x, tp):
sys.stdout = file_tp
print tp(x)
sys.stdout = file
- if x in _REF:
- print _REF[x]
+ if tp(x) in _REF:
+ print _REF[tp(x)]
else:
print x
finally: