Skip to content

Commit 2c22662

Browse files
committed
Seed flaky test
1 parent b1763c7 commit 2c22662

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pymc_experimental/tests/test_marginal_model.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ def test_not_supported_marginalized():
296296

297297
@pytest.mark.filterwarnings("error")
298298
def test_marginalized_deterministic_and_potential():
299+
rng = np.random.default_rng(299)
300+
299301
with MarginalModel() as m:
300302
x = pm.Bernoulli("x", p=0.7)
301303
y = pm.Normal("y", x)
@@ -306,7 +308,7 @@ def test_marginalized_deterministic_and_potential():
306308
with pytest.warns(UserWarning, match="There are multiple dependent variables"):
307309
m.marginalize([x])
308310

309-
y_draw, z_draw, det_draw, pot_draw = pm.draw([y, z, det, pot], draws=5)
311+
y_draw, z_draw, det_draw, pot_draw = pm.draw([y, z, det, pot], draws=5, random_seed=rng)
310312
np.testing.assert_almost_equal(y_draw + z_draw, det_draw)
311313
np.testing.assert_almost_equal(det_draw, pot_draw - 1)
312314

0 commit comments

Comments
 (0)