@@ -519,7 +519,8 @@ def test(y_true, y_pred):
519519        assert_array_almost_equal (mcc , 0.57 , decimal = 2 )
520520
521521    test (y_true , y_pred )
522-     test (map (str , y_true ), map (str , y_pred ))
522+     test ([str (y ) for  y  in  y_true ],
523+          [str (y ) for  y  in  y_pred ])
523524
524525
525526def  test_matthews_corrcoef_nan ():
@@ -639,7 +640,9 @@ def test(y_true, y_pred, string_type=False):
639640                                [4 , 24 , 3 ]])
640641
641642    test (y_true , y_pred )
642-     test (map (str , y_true ), map (str , y_pred ), string_type = True )
643+     test (list (str (y ) for  y  in  y_true ),
644+          list (str (y ) for  y  in  y_pred ),
645+          string_type = True )
643646
644647
645648def  test_confusion_matrix_multiclass_subset_labels ():
@@ -820,7 +823,7 @@ def test_losses():
820823    assert_equal (accuracy_score (y_true , y_pred ),
821824                 1  -  zero_one_loss (y_true , y_pred ))
822825
823-     with  warnings .catch_warnings (True ):
826+     with  warnings .catch_warnings (record = True ):
824827    # Throw deprecated warning 
825828        assert_equal (zero_one_score (y_true , y_pred ),
826829                     1  -  zero_one_loss (y_true , y_pred ))
@@ -1001,7 +1004,7 @@ def test_hinge_loss_binary():
10011004    pred_decision  =  np .array ([- 8.5 , 0.5 , 1.5 , - 0.3 ])
10021005    assert_equal (hinge_loss (y_true , pred_decision ), 1.2  /  4 )
10031006
1004-     with  warnings .catch_warnings (True ):
1007+     with  warnings .catch_warnings (record = True ):
10051008        # Test deprecated pos_label 
10061009        assert_equal (
10071010            hinge_loss (- y_true , pred_decision ),
@@ -1011,7 +1014,7 @@ def test_hinge_loss_binary():
10111014    pred_decision  =  np .array ([- 8.5 , 0.5 , 1.5 , - 0.3 ])
10121015
10131016    assert_equal (hinge_loss (y_true , pred_decision ), 1.2  /  4 )
1014-     with  warnings .catch_warnings (True ):
1017+     with  warnings .catch_warnings (record = True ):
10151018        # Test deprecated pos_label 
10161019        assert_equal (hinge_loss (y_true , pred_decision , pos_label = 2 ,
10171020                                neg_label = 0 ), 1.2  /  4 )
0 commit comments