Skip to content

Commit 8477d63

Browse files
authored
MAINT cosmetic improvement in _non_trivial_radius test helper (scikit-learn#27486)
1 parent cdcfcbe commit 8477d63

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sklearn/metrics/tests/test_pairwise_distances_reduction.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,10 @@ def _non_trivial_radius(
228228
# on average. Yielding too many results would make the test slow (because
229229
# checking the results is expensive for large result sets), yielding 0 most
230230
# of the time would make the test useless.
231-
if precomputed_dists is None and metric is None:
232-
raise ValueError("Either metric or dists must be provided")
231+
assert (
232+
precomputed_dists is not None or metric is not None
233+
), "Either metric or precomputed_dists must be provided."
234+
233235
if precomputed_dists is None:
234236
assert X is not None
235237
assert Y is not None

0 commit comments

Comments
 (0)