Skip to content

Commit

Permalink
MAINT cosmetic improvement in _non_trivial_radius test helper (#27486)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogrisel committed Sep 28, 2023
1 parent cdcfcbe commit 8477d63
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sklearn/metrics/tests/test_pairwise_distances_reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,10 @@ def _non_trivial_radius(
# on average. Yielding too many results would make the test slow (because
# checking the results is expensive for large result sets), yielding 0 most
# of the time would make the test useless.
if precomputed_dists is None and metric is None:
raise ValueError("Either metric or dists must be provided")
assert (
precomputed_dists is not None or metric is not None
), "Either metric or precomputed_dists must be provided."

if precomputed_dists is None:
assert X is not None
assert Y is not None
Expand Down

0 comments on commit 8477d63

Please sign in to comment.