Skip to content

Commit 2761937

Browse files
committed
Fix error with seed
1 parent 9511a60 commit 2761937

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import numpy as np
1515
import pandas as pd
16-
from numpy.random import choice, rand, randint
16+
from numpy.random import choice, default_rng, rand, randint
1717
from pytest import fixture
1818
from xarray import DataArray, Dataset
1919

@@ -84,8 +84,9 @@ def patch_broadcast_compat_data():
8484
@fixture(autouse=True)
8585
def random():
8686
"""Set random seed for all tests to make them reproducible."""
87-
rand.seed(RANDOM_SEED)
87+
rng = default_rng(RANDOM_SEED)
8888
np.random.seed(RANDOM_SEED)
89+
return rng
8990

9091

9192
def compare_df(

0 commit comments

Comments
 (0)