summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2014-02-21 15:15:32 -0700
committerCharles Harris <charlesr.harris@gmail.com>2014-02-21 15:15:32 -0700
commitdd857489fcaa745ea569c523249fe37537bfe280 (patch)
treeb23a9b6a4af4bbedf3be237b97d1faf973e6e78e /numpy/lib/tests/test_function_base.py
parent34d7bee3d472e5b97c1ea7c8d7e8d9949a9ebc16 (diff)
parentfd399aaee5b703744f508fb2ce4718e1f4bc8984 (diff)
downloadnumpy-dd857489fcaa745ea569c523249fe37537bfe280.tar.gz
Merge pull request #4342 from seberg/issue-4340
TST: do not use "ignore" to filter warnings
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r--numpy/lib/tests/test_function_base.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 003d3e541..fee838ecf 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -1222,8 +1222,8 @@ class TestCorrCoef(TestCase):
assert_allclose(np.corrcoef(x, y), np.array([[1., -1.j], [1.j, 1.]]))
def test_empty(self):
- with warnings.catch_warnings():
- warnings.simplefilter('ignore', RuntimeWarning)
+ with warnings.catch_warnings(record=True):
+ warnings.simplefilter('always', RuntimeWarning)
assert_array_equal(corrcoef(np.array([])), np.nan)
assert_array_equal(corrcoef(np.array([]).reshape(0, 2)),
np.array([]).reshape(0, 0))
@@ -1232,8 +1232,8 @@ class TestCorrCoef(TestCase):
def test_wrong_ddof(self):
x = np.array([[0, 2], [1, 1], [2, 0]]).T
- with warnings.catch_warnings():
- warnings.simplefilter('ignore', RuntimeWarning)
+ with warnings.catch_warnings(record=True):
+ warnings.simplefilter('always', RuntimeWarning)
assert_array_equal(corrcoef(x, ddof=5),
np.array([[np.nan, np.nan], [np.nan, np.nan]]))
@@ -1253,8 +1253,8 @@ class TestCov(TestCase):
assert_allclose(cov(x, y), np.array([[1., -1.j], [1.j, 1.]]))
def test_empty(self):
- with warnings.catch_warnings():
- warnings.simplefilter('ignore', RuntimeWarning)
+ with warnings.catch_warnings(record=True):
+ warnings.simplefilter('always', RuntimeWarning)
assert_array_equal(cov(np.array([])), np.nan)
assert_array_equal(cov(np.array([]).reshape(0, 2)),
np.array([]).reshape(0, 0))
@@ -1263,8 +1263,8 @@ class TestCov(TestCase):
def test_wrong_ddof(self):
x = np.array([[0, 2], [1, 1], [2, 0]]).T
- with warnings.catch_warnings():
- warnings.simplefilter('ignore', RuntimeWarning)
+ with warnings.catch_warnings(record=True):
+ warnings.simplefilter('always', RuntimeWarning)
assert_array_equal(cov(x, ddof=5),
np.array([[np.inf, -np.inf], [-np.inf, np.inf]]))