From ca05d523c3d022eba8ea1bf75b50c60550d30d5a Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Sun, 7 May 2017 16:06:20 +0200 Subject: BUG: Remove warning NaT filter from masked array test utils This may show warnings in downstream projects, which should likely not be there. We could also drop in the normal assert_equal there, which would support NaT, and NaN, but checks for scalarness, which this currently does not (which also could create problems). Works around the only test with this problem, by using the normal assert_equal there. --- numpy/ma/testutils.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'numpy/ma/testutils.py') diff --git a/numpy/ma/testutils.py b/numpy/ma/testutils.py index 866316c62..c19066d71 100644 --- a/numpy/ma/testutils.py +++ b/numpy/ma/testutils.py @@ -14,7 +14,7 @@ from numpy import ndarray, float_ import numpy.core.umath as umath from numpy.testing import ( TestCase, assert_, assert_allclose, assert_array_almost_equal_nulp, - assert_raises, build_err_msg, run_module_suite, suppress_warnings + assert_raises, build_err_msg, run_module_suite ) import numpy.testing.utils as utils from .core import mask_or, getmask, masked_array, nomask, masked, filled @@ -126,10 +126,8 @@ def assert_equal(actual, desired, err_msg=''): return _assert_equal_on_sequences(actual, desired, err_msg='') if not (isinstance(actual, ndarray) or isinstance(desired, ndarray)): msg = build_err_msg([actual, desired], err_msg,) - with suppress_warnings() as sup: - sup.filter(FutureWarning, ".*NAT ==") - if not desired == actual: - raise AssertionError(msg) + if not desired == actual: + raise AssertionError(msg) return # Case #4. arrays or equivalent if ((actual is masked) and not (desired is masked)) or \ -- cgit v1.2.1