TST Remove test for sparse matrices and minkowski
@@ -298,24 +298,13 @@ def callable_rbf_kernel(x, y, **kwds):
(pairwise_kernels, callable_rbf_kernel, {"gamma": 0.1}),
],
)
-@pytest.mark.parametrize("array_constr", [np.array, csr_matrix])
@pytest.mark.parametrize("dtype", [np.float64, int])
-def test_pairwise_parallel(func, metric, kwds, array_constr, dtype):
+def test_pairwise_parallel(func, metric, kwds, dtype):
rng = np.random.RandomState(0)
- X = array_constr(5 * rng.random_sample((5, 4)), dtype=dtype)
- Y = array_constr(5 * rng.random_sample((3, 4)), dtype=dtype)
+ X = np.array(5 * rng.random_sample((5, 4)), dtype=dtype)
+ Y = np.array(5 * rng.random_sample((3, 4)), dtype=dtype)
- try:
S = func(X, metric=metric, n_jobs=1, **kwds)
- except (TypeError, ValueError) as exc:
- # Not all metrics support sparse input
- # ValueError may be triggered by bad callable
- if array_constr is csr_matrix:
- with pytest.raises(type(exc)):
- func(X, metric=metric, n_jobs=2, **kwds)
- return
- else:
- raise
S2 = func(X, metric=metric, n_jobs=2, **kwds)
assert_allclose(S, S2)
