Skip to content

Commit

Permalink
Seed flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoV94 committed Mar 30, 2023
1 parent b1763c7 commit 2c22662
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pymc_experimental/tests/test_marginal_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ def test_not_supported_marginalized():

@pytest.mark.filterwarnings("error")
def test_marginalized_deterministic_and_potential():
rng = np.random.default_rng(299)

with MarginalModel() as m:
x = pm.Bernoulli("x", p=0.7)
y = pm.Normal("y", x)
Expand All @@ -306,7 +308,7 @@ def test_marginalized_deterministic_and_potential():
with pytest.warns(UserWarning, match="There are multiple dependent variables"):
m.marginalize([x])

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

Expand Down

0 comments on commit 2c22662

Please sign in to comment.