@@ -188,14 +188,14 @@ def test_roc_curve_one_label():
188188 y_true = [1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ]
189189 y_pred = [0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 ]
190190 # assert there are warnings
191- with warnings .catch_warnings (True ) as w :
191+ with warnings .catch_warnings (record = True ) as w :
192192 fpr , tpr , thresholds = roc_curve (y_true , y_pred )
193193 assert_equal (len (w ), 1 )
194194 # all true labels, all fpr should be nan
195195 assert_array_equal (fpr ,
196196 np .nan * np .ones (len (thresholds ) + 1 ))
197197 # assert there are warnings
198- with warnings .catch_warnings (True ) as w :
198+ with warnings .catch_warnings (record = True ) as w :
199199 fpr , tpr , thresholds = roc_curve ([1 - x for x in y_true ],
200200 y_pred )
201201 assert_equal (len (w ), 1 )
@@ -568,7 +568,7 @@ def test_losses():
568568
569569 # Classification
570570 # --------------
571- with warnings .catch_warnings (True ):
571+ with warnings .catch_warnings (record = True ):
572572 # Throw deprecated warning
573573 assert_equal (zero_one (y_true , y_pred ), 13 )
574574 assert_almost_equal (zero_one (y_true , y_pred , normalize = True ),
@@ -589,7 +589,7 @@ def test_losses():
589589 assert_equal (accuracy_score (y_true , y_pred , normalize = False ),
590590 n_samples - zero_one_loss (y_true , y_pred , normalize = False ))
591591
592- with warnings .catch_warnings (True ):
592+ with warnings .catch_warnings (record = True ):
593593 # Throw deprecated warning
594594 assert_equal (zero_one_score (y_true , y_pred ),
595595 1 - zero_one_loss (y_true , y_pred ))
@@ -661,7 +661,7 @@ def test_symmetry():
661661 msg = "%s seems to be symetric" % metric )
662662
663663 # Deprecated metrics
664- with warnings .catch_warnings (True ):
664+ with warnings .catch_warnings (record = True ):
665665 # Throw deprecated warning
666666 assert_equal (zero_one (y_true , y_pred ),
667667 zero_one (y_pred , y_true ))
0 commit comments