summaryrefslogtreecommitdiff
path: root/numpy/ma/tests/test_regression.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2016-06-19 14:18:35 +0200
committerSebastian Berg <sebastian@sipsolutions.net>2016-09-02 10:10:55 +0200
commit308161c80f4450f05f8399343034308bd18b4e1e (patch)
treeba3778d778e1222e93246ca7842e8f060e411173 /numpy/ma/tests/test_regression.py
parentc1ddf841f6a48248b946a990ae750505b8b91686 (diff)
downloadnumpy-308161c80f4450f05f8399343034308bd18b4e1e.tar.gz
TST: Use new warnings context manager in all tests
In some places, just remove aparently unnecessary filters. After this, all cases of ignore filters should be removed from the tests, making testing (even multiple runs) normally fully predictable.
Diffstat (limited to 'numpy/ma/tests/test_regression.py')
-rw-r--r--numpy/ma/tests/test_regression.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/ma/tests/test_regression.py b/numpy/ma/tests/test_regression.py
index dba74d357..fc6cdfaff 100644
--- a/numpy/ma/tests/test_regression.py
+++ b/numpy/ma/tests/test_regression.py
@@ -4,7 +4,8 @@ import warnings
import numpy as np
from numpy.testing import (assert_, TestCase, assert_array_equal,
- assert_allclose, run_module_suite)
+ assert_allclose, run_module_suite,
+ suppress_warnings)
from numpy.compat import sixu
rlevel = 1
@@ -69,8 +70,9 @@ class TestRegression(TestCase):
# See gh-3336
x = np.ma.masked_equal([1, 2, 3, 4, 5], 4)
y = np.array([2, 2.5, 3.1, 3, 5])
- with warnings.catch_warnings():
- warnings.simplefilter("ignore")
+ # this test can be removed after deprecation.
+ with suppress_warnings() as sup:
+ sup.filter(DeprecationWarning, "bias and ddof have no effect")
r0 = np.ma.corrcoef(x, y, ddof=0)
r1 = np.ma.corrcoef(x, y, ddof=1)
# ddof should not have an effect (it gets cancelled out)