From c4a556e1fcdede5fe366e4373a7f2dc802a0e898 Mon Sep 17 00:00:00 2001 From: Mark Wiebe Date: Wed, 26 Jan 2011 10:57:17 -0800 Subject: BUG: core: Fix things so scipy trunk passes all tests (but one) With this patch, the latest scipy trunk (7087), built against NumPy 1.5.1, passes all tests when run against the numpy trunk. The single failing test, test_imresize, fails because it tests all float types, and the new 'half' type lacks the precision to pass that test. --- numpy/testing/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'numpy/testing/utils.py') diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index 6f18b5468..1a03f98ea 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -421,7 +421,7 @@ def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True): usecomplex = False msg = build_err_msg([actual, desired], err_msg, verbose=verbose, - header='Arrays are not almost equal') + header=('Arrays are not almost equal to %d decimals' % decimal)) if usecomplex: if iscomplexobj(actual): @@ -616,7 +616,8 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True, names=('x', 'y')) if not cond : raise AssertionError(msg) - except ValueError: + except ValueError as e: + header = 'error during assertion:\n%s\n\n%s' % (e, header) msg = build_err_msg([x, y], err_msg, verbose=verbose, header=header, names=('x', 'y')) raise ValueError(msg) @@ -771,7 +772,7 @@ def assert_array_almost_equal(x, y, decimal=6, err_msg='', verbose=True): z = z.astype(float_) # handle object arrays return around(z, decimal) <= 10.0**(-decimal) assert_array_compare(compare, x, y, err_msg=err_msg, verbose=verbose, - header='Arrays are not almost equal') + header=('Arrays are not almost equal to %d decimals' % decimal)) def assert_array_less(x, y, err_msg='', verbose=True): """ -- cgit v1.2.1