From f69ddd7111048111a7e486a2d7d008bd231af33d Mon Sep 17 00:00:00 2001 From: Simon Surland Andersen Date: Tue, 8 Feb 2022 14:43:36 +0100 Subject: ENH: Suppress over-/underflow RuntimeWarning in assert_array_equal (#21003) * TST: Test suppression of asset_array_equal RuntimeWarning See #18992 * ENH: Suppress over-/underflow warnings on asset_array_equal - Closes #18992 * MAINT: Resolve linting issues of prior commit * MAINT: Simplified ignore and test case of asset_array_equal * MAINT: Removed unused import in test_utils.py --- numpy/testing/_private/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/testing/_private/utils.py') diff --git a/numpy/testing/_private/utils.py b/numpy/testing/_private/utils.py index 2c71e45bd..80a6fdd10 100644 --- a/numpy/testing/_private/utils.py +++ b/numpy/testing/_private/utils.py @@ -810,7 +810,7 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True, header='', 'Mismatched elements: {} / {} ({:.3g}%)'.format( n_mismatch, n_elements, percent_mismatch)] - with errstate(invalid='ignore', divide='ignore'): + with errstate(all='ignore'): # ignore errors for non-numeric types with contextlib.suppress(TypeError): error = abs(x - y) -- cgit v1.2.1