summaryrefslogtreecommitdiff
path: root/numpy/ma/testutils.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2016-09-02 09:11:59 -0500
committerGitHub <noreply@github.com>2016-09-02 09:11:59 -0500
commit9164f23c19c049e28d4d4825a53bbb01aedabcfc (patch)
treef017b7eb7565690a755263df12c835d61e89a8a4 /numpy/ma/testutils.py
parent8eedd3e911b7e3f5f35961871ddb8ee1559d4225 (diff)
parent514d13679a55a82a96689679002c4ddc514641ce (diff)
downloadnumpy-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.py8
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 \