Skip to content
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
5 changes: 4 additions & 1 deletion pymc/tests/distributions/test_truncated.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ def test_truncation_discrete_random(op_type, lower, upper):
assert np.any(xt_draws == upper)
else:
with pytest.raises(TruncationError, match="^Truncation did not converge"):
draw(xt)
# Rejections sampling with probability = (1 - p ** max_n_steps) ** sample_size =
# = (1 - 0.2 ** 3) ** 500 = 0.018
# Still, this probability can be too high to make this test pass with any seed.
draw(xt, random_seed=2297228)


@pytest.mark.parametrize("lower, upper", [(2, np.inf), (2, 5), (-np.inf, 5)])
Expand Down