Skip to content
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

Fix flaky TestMixture.test_component_choice_random #6222

Merged
merged 6 commits into from
Oct 21, 2022
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: 2 additions & 2 deletions pymc/tests/distributions/test_mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ def test_component_choice_random(self):
weights = [0.5, 0.5]
components = [Normal.dist(-10, 0.01), Normal.dist(10, 0.01)]
mix = Mixture.dist(weights, components)
draws = draw(mix, draws=10)
# Probability of coming from same component 10 times is 0.5**10
draws = draw(mix, draws=20, random_seed=self.get_random_state())
# Probability of coming from same component 20 times is 0.5**20
assert np.unique(draws > 0).size == 2
ricardoV94 marked this conversation as resolved.
Show resolved Hide resolved

@pytest.mark.parametrize(
Expand Down