Skip to content

Commit a0f849a

Browse files
Fix flaky TestMixture.test_component_choice_random (#6222)
* TST: Fix seed for draws * TST: Use binomial test * TST: Revert to previous assertion * TST: Increase draws to 200 * Implement suggestion to lower draws to 20 Co-authored-by: Ricardo Vieira <[email protected]> * Correct comment to match the number of draws Co-authored-by: Ricardo Vieira <[email protected]>
1 parent 98aadfd commit a0f849a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymc/tests/distributions/test_mixture.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ def test_component_choice_random(self):
333333
weights = [0.5, 0.5]
334334
components = [Normal.dist(-10, 0.01), Normal.dist(10, 0.01)]
335335
mix = Mixture.dist(weights, components)
336-
draws = draw(mix, draws=10)
337-
# Probability of coming from same component 10 times is 0.5**10
336+
draws = draw(mix, draws=20, random_seed=self.get_random_state())
337+
# Probability of coming from same component 20 times is 0.5**20
338338
assert np.unique(draws > 0).size == 2
339339

340340
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)