diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-09-02 09:11:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-02 09:11:59 -0500 |
commit | 9164f23c19c049e28d4d4825a53bbb01aedabcfc (patch) | |
tree | f017b7eb7565690a755263df12c835d61e89a8a4 /numpy/ma/testutils.py | |
parent | 8eedd3e911b7e3f5f35961871ddb8ee1559d4225 (diff) | |
parent | 514d13679a55a82a96689679002c4ddc514641ce (diff) | |
download | numpy-9164f23c19c049e28d4d4825a53bbb01aedabcfc.tar.gz |
Merge pull request #7099 from seberg/suppressed_warnings
Suppressed warnings
Diffstat (limited to 'numpy/ma/testutils.py')
-rw-r--r-- | numpy/ma/testutils.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/ma/testutils.py b/numpy/ma/testutils.py index 8dc821878..866316c62 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, + assert_raises, build_err_msg, run_module_suite, suppress_warnings ) import numpy.testing.utils as utils from .core import mask_or, getmask, masked_array, nomask, masked, filled @@ -126,8 +126,10 @@ 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,) - if not desired == actual: - raise AssertionError(msg) + with suppress_warnings() as sup: + sup.filter(FutureWarning, ".*NAT ==") + if not desired == actual: + raise AssertionError(msg) return # Case #4. arrays or equivalent if ((actual is masked) and not (desired is masked)) or \ |