diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2022-05-26 20:48:02 -0700 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2022-06-15 11:42:02 -0700 |
commit | baaeb9a16c9c28683db97c4fc3d047e86d32a0c5 (patch) | |
tree | 0070a9e10de564c6d6b7d66548419e684cfca77c /numpy/testing/_private/utils.py | |
parent | 2a6a3931c0af78180fa6984fd09bc0264c156fd0 (diff) | |
download | numpy-baaeb9a16c9c28683db97c4fc3d047e86d32a0c5.tar.gz |
WIP: Add warning context manager and fix min_scalar for new promotion
Even the new promotion has to use the min-scalar logic to avoid
picking up a float16 loop for `np.int8(3) * 3.`.
Diffstat (limited to 'numpy/testing/_private/utils.py')
-rw-r--r-- | numpy/testing/_private/utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/testing/_private/utils.py b/numpy/testing/_private/utils.py index e4f8b9892..ca64446db 100644 --- a/numpy/testing/_private/utils.py +++ b/numpy/testing/_private/utils.py @@ -473,6 +473,7 @@ def print_assert_equal(test_string, actual, desired): raise AssertionError(msg.getvalue()) +@np.no_nep50_warning() def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True): """ Raises an AssertionError if two items are not equal up to desired @@ -599,6 +600,7 @@ def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True): raise AssertionError(_build_err_msg()) +@np.no_nep50_warning() def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=True): """ Raises an AssertionError if two items are not equal up to significant @@ -698,6 +700,7 @@ def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=True): raise AssertionError(msg) +@np.no_nep50_warning() def assert_array_compare(comparison, x, y, err_msg='', verbose=True, header='', precision=6, equal_nan=True, equal_inf=True): __tracebackhide__ = True # Hide traceback for py.test @@ -935,6 +938,7 @@ def assert_array_equal(x, y, err_msg='', verbose=True): verbose=verbose, header='Arrays are not equal') +@np.no_nep50_warning() def assert_array_almost_equal(x, y, decimal=6, err_msg='', verbose=True): """ Raises an AssertionError if two objects are not equal up to desired |