diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2012-05-02 21:06:06 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2012-05-02 21:06:06 -0600 |
commit | 259fff8f08dabd8198d2ec0f5abe99a05a5477d5 (patch) | |
tree | fe93995bd0822b7415fbb6f3b27a782523c89dc7 | |
parent | 0b99c90e3f6004789fa5115e14234a8d6f4a07bd (diff) | |
download | numpy-259fff8f08dabd8198d2ec0f5abe99a05a5477d5.tar.gz |
BUG: Fix some test bugs.
Fix incorrect python version checks in test_print.py.
Fix missing build_err_msg import and wrong variable in test_io.py.
-rw-r--r-- | numpy/core/tests/test_print.py | 6 | ||||
-rw-r--r-- | numpy/lib/tests/test_io.py | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/numpy/core/tests/test_print.py b/numpy/core/tests/test_print.py index 09b20cc3e..d40275ef4 100644 --- a/numpy/core/tests/test_print.py +++ b/numpy/core/tests/test_print.py @@ -87,7 +87,7 @@ def test_complex_types(): def test_complex_inf_nan(): """Check inf/nan formatting of complex types.""" - if sys.version_info >= (2, 6): + if sys.version_info[:2] >= (2, 6): TESTS = { complex(np.inf, 0): "(inf+0j)", complex(0, np.inf): "inf*j", @@ -198,7 +198,7 @@ def test_complex_type_print(): for t in [np.complex64, np.cdouble, np.clongdouble] : yield check_complex_type_print, t -@dec.skipif(sys.version_info < (2,6)) +@dec.skipif(sys.version_info[:2] < (2, 6)) def test_scalar_format(): """Test the str.format method with NumPy scalar types""" tests = [('{0}', True, np.bool_), @@ -216,7 +216,7 @@ def test_scalar_format(): ('{0:g}', 1.5, np.float64), ('{0:g}', 1.5, np.longdouble)] # Python 2.6 doesn't implement complex.__format__ - if sys.version_info <= (2,6): + if sys.version_info[:2] > (2, 6): tests += [('{0:g}', 1.5+0.5j, np.complex64), ('{0:g}', 1.5+0.5j, np.complex128), ('{0:g}', 1.5+0.5j, np.clongdouble)] diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index c62e586b5..8922070df 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -18,7 +18,7 @@ from numpy.compat import asbytes, asbytes_nested, bytes from nose import SkipTest from numpy.ma.testutils import (TestCase, assert_equal, assert_array_equal, assert_raises, run_module_suite) -from numpy.testing import assert_warns, assert_ +from numpy.testing import assert_warns, assert_, build_err_msg if sys.version_info[0] >= 3: from io import BytesIO @@ -321,10 +321,10 @@ def _assert_floatstr_lines_equal(actual_lines, expected_lines): of this function. """ for actual, expected in zip(actual_lines, expected_lines): - if not actual == expected: + if actual != expected: expected_win25 = expected.replace("e+00", "e+000") - if not actual == expected_win25: - msg = build_err_msg([actual, desired], verbose=True) + if actual != expected_win25: + msg = build_err_msg([actual, expected], '', verbose=True) raise AssertionError(msg) |