Skip to content

Commit ee8515e

Browse files
committed
parameterize seeds used in test
1 parent db29b5b commit ee8515e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

causalpy/tests/test_pymc_models.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,19 @@ def test_idata_property():
125125
assert isinstance(result.idata, az.InferenceData)
126126

127127

128-
def test_result_reproducibility():
128+
seeds = [1234, 42, 123456789]
129+
130+
131+
@pytest.mark.parametrize("seed", seeds)
132+
def test_result_reproducibility(seed):
129133
"""Test that we can reproduce the results from the model. We could in theory test
130134
this with all the model and experiment types, but what is being targetted is
131135
the ModelBuilder.fit method, so we should be safe testing with just one model. Here
132136
we use the DifferenceInDifferences experiment class."""
133137
# Load the data
134138
df = cp.load_data("did")
135139
# Set a random seed
136-
sample_kwargs["random_seed"] = 42
140+
sample_kwargs["random_seed"] = seed
137141
# Calculate the result twice
138142
result1 = cp.pymc_experiments.DifferenceInDifferences(
139143
df,

0 commit comments

Comments
 (0)