10000 TST use global_random_seed in sklearn/cluster/tests/test_dbscan.py (#… · scikit-learn/scikit-learn@625650f · GitHub
[go: up one dir, main page]

Skip to content

Commit 625650f

Browse files
authored
TST use global_random_seed in sklearn/cluster/tests/test_dbscan.py (#24598)
1 parent 5af75b9 commit 625650f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sklearn/cluster/tests/test_dbscan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def test_boundaries():
286286
assert 0 not in core
287287

288288

289-
def test_weighted_dbscan():
289+
def test_weighted_dbscan(global_random_seed):
290290
# ensure sample_weight is validated
291291
with pytest.raises(ValueError):
292292
dbscan([[0], [1]], sample_weight=[2])
@@ -320,7 +320,7 @@ def test_weighted_dbscan():
320320
)
321321

322322
# for non-negative sample_weight, cores should be identical to repetition
323-
rng = np.random.RandomState(42)
323+
rng = np.random.RandomState(global_random_seed)
324324
sample_weight = rng.randint(0, 5, X.shape[0])
325325
core1, label1 = dbscan(X, sample_weight=sample_weight)
326326
assert len(label1) == len(X)

0 commit comments

Comments
 (0)
0