@@ -1222,8 +1222,8 @@ def test_xy(self):
12221222 assert_allclose (np .corrcoef (x , y ), np .array ([[1. , - 1.j ], [1.j , 1. ]]))
12231223
12241224 def test_empty (self ):
1225- with warnings .catch_warnings ():
1226- warnings .simplefilter ('ignore ' , RuntimeWarning )
1225+ with warnings .catch_warnings (record = True ):
1226+ warnings .simplefilter ('always ' , RuntimeWarning )
12271227 assert_array_equal (corrcoef (np .array ([])), np .nan )
12281228 assert_array_equal (corrcoef (np .array ([]).reshape (0 , 2 )),
12291229 np .array ([]).reshape (0 , 0 ))
@@ -1232,8 +1232,8 @@ def test_empty(self):
12321232
12331233 def test_wrong_ddof (self ):
12341234 x = np .array ([[0 , 2 ], [1 , 1 ], [2 , 0 ]]).T
1235- with warnings .catch_warnings ():
1236- warnings .simplefilter ('ignore ' , RuntimeWarning )
1235+ with warnings .catch_warnings (record = True ):
1236+ warnings .simplefilter ('always ' , RuntimeWarning )
12371237 assert_array_equal (corrcoef (x , ddof = 5 ),
12381238 np .array ([[np .nan , np .nan ], [np .nan , np .nan ]]))
12391239
@@ -1253,8 +1253,8 @@ def test_xy(self):
12531253 assert_allclose (cov (x , y ), np .array ([[1. , - 1.j ], [1.j , 1. ]]))
12541254
12551255 def test_empty (self ):
1256- with warnings .catch_warnings ():
1257- warnings .simplefilter ('ignore ' , RuntimeWarning )
1256+ with warnings .catch_warnings (record = True ):
1257+ warnings .simplefilter ('always ' , RuntimeWarning )
12581258 assert_array_equal (cov (np .array ([])), np .nan )
12591259 assert_array_equal (cov (np .array ([]).reshape (0 , 2 )),
12601260 np .array ([]).reshape (0 , 0 ))
@@ -1263,8 +1263,8 @@ def test_empty(self):
12631263
12641264 def test_wrong_ddof (self ):
12651265 x = np .array ([[0 , 2 ], [1 , 1 ], [2 , 0 ]]).T
1266- with warnings .catch_warnings ():
1267- warnings .simplefilter ('ignore ' , RuntimeWarning )
1266+ with warnings .catch_warnings (record = True ):
1267+ warnings .simplefilter ('always ' , RuntimeWarning )
12681268 assert_array_equal (cov (x , ddof = 5 ),
12691269 np .array ([[np .inf , - np .inf ], [- np .inf , np .inf ]]))
12701270
0 commit comments