FIX silently omitted tests in test_neighbors.py
@@ -971,8 +971,8 @@ def test_neighbors_badargs():
assert_raises(ValueError,
nbrs.predict,
[[]])
- if (isinstance(cls, neighbors.KNeighborsClassifier) or
- isinstance(cls, neighbors.KNeighborsRegressor)):
+ if (issubclass(cls, neighbors.KNeighborsClassifier) or
+ issubclass(cls, neighbors.KNeighborsRegressor)):
nbrs = cls(n_neighbors=-1)
assert_raises(ValueError, nbrs.fit, X, y)
@@ -1215,9 +1215,9 @@ def test_k_and_radius_neighbors_X_None():
rng = nn.radius_neighbors_graph(None, radius=1.5)
kng = nn.kneighbors_graph(None)
for graph in [rng, kng]:
- assert_array_equal(rng.A, [[0, 1], [1, 0]])
- assert_array_equal(rng.data, [1, 1])
- assert_array_equal(rng.indices, [1, 0])
+ assert_array_equal(graph.A, [[0, 1], [1, 0]])
+ assert_array_equal(graph.data, [1, 1])
+ assert_array_equal(graph.indices, [1, 0])
X = [[0, 1], [0, 1], [1, 1]]
nn = neighbors.NearestNeighbors(n_neighbors=2, algorithm=algorithm)
