diff options
author | David Cournapeau <cournape@gmail.com> | 2008-12-30 06:01:31 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-12-30 06:01:31 +0000 |
commit | ddf0d0dee18eab8c8e30f9809c38fa641b9afaa8 (patch) | |
tree | 52f1ebefc899a3692e4eebac1b3f5c7f8d7b7e79 /numpy | |
parent | 459125ba40852b2e4fa897500abbafad6390f692 (diff) | |
download | numpy-ddf0d0dee18eab8c8e30f9809c38fa641b9afaa8.tar.gz |
More fixes for print tests.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/tests/test_print.py | 18 |
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: |