Skip to content

Commit ce18ba2

Browse files
committed
TST: use a fixed seed to have the same uniques across python versions
1 parent 29008f5 commit ce18ba2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas/tests/resample/test_datetime_index.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1160,9 +1160,13 @@ def test_resample_nunique_with_date_gap():
11601160
@pytest.mark.parametrize('k', [10, 100, 1000])
11611161
def test_resample_group_info(n, k):
11621162
# GH10914
1163+
1164+
# use a fixed seed to always have the same uniques
1165+
prng = np.random.RandomState(1234)
1166+
11631167
dr = date_range(start='2015-08-27', periods=n // 10, freq='T')
1164-
ts = Series(np.random.randint(0, n // k, n).astype('int64'),
1165-
index=np.random.choice(dr, n))
1168+
ts = Series(prng.randint(0, n // k, n).astype('int64'),
1169+
index=prng.choice(dr, n))
11661170

11671171
left = ts.resample('30T').nunique()
11681172
ix = date_range(start=ts.index.min(), end=ts.index.max(),

0 commit comments

Comments
 (0)