def test_set_randomstate_exception(bs_setup): bs = IIDBootstrap(bs_setup.x) rs = np.array([1, 2, 3, 4]) with pytest.raises(TypeError, match="Value being set must be a RandomState"): bs.random_state = rs
def test_set_randomstate(bs_setup): bs = IIDBootstrap(bs_setup.x) rs = np.random.RandomState([12345]) bs.random_state = rs assert bs.random_state is rs