@@ -1317,11 +1317,12 @@ def test_same_radius_neighbors_parallel(algorithm):
13171317 assert_array_equal (ind [i ], ind_parallel [i ])
13181318 assert_array_almost_equal (graph , graph_parallel )
13191319
1320+
13201321@pytest .mark .parametrize ('backend' , ['loky' , 'multiprocessing' , 'threading' ])
13211322@pytest .mark .parametrize ('algorithm' , ALGORITHMS )
13221323def test_knn_forcing_backend (backend , algorithm ):
1323- # Non-regression test which ensure the knn is properly working
1324- # even when forcing the global joblib backend
1324+ # Non-regression test which ensure the knn methods are properly working
1325+ # even when forcing the global joblib backend.
13251326 with parallel_backend (backend ):
13261327 X , y = datasets .make_classification (n_samples = 30 , n_features = 5 ,
13271328 n_redundant = 0 , random_state = 0 )
@@ -1331,9 +1332,9 @@ def test_knn_forcing_backend(backend, algorithm):
13311332 algorithm = algorithm ,
13321333 n_jobs = 3 )
13331334 clf .fit (X_train , y_train )
1334- y = clf .predict (X_test )
1335- dist , ind = clf .kneighbors (X_test )
1336- graph = clf .kneighbors_graph (X_test , mode = 'distance' ).toarray ()
1335+ clf .predict (X_test )
1336+ clf .kneighbors (X_test )
1337+ clf .kneighbors_graph (X_test , mode = 'distance' ).toarray ()
13371338
13381339
13391340def test_dtype_convert ():
0 commit comments