Skip to content

Seed flaky test #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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