Skip to content

Commit a232e4c

Browse files
committed
revert changes to irrelevant test
1 parent f3c0f29 commit a232e4c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/distributions/test_discrete.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import pytest
2020
import scipy.stats
2121

22+
from pymc.logprob.utils import ParameterValueError
2223
from pymc.testing import (
2324
BaseTestDistributionRandom,
2425
Domain,
@@ -92,11 +93,15 @@ def test_logp_matches_poisson(self):
9293
logp_fn(-1, mu=5, lam=0) == -np.inf
9394
logp_fn(9, mu=5, lam=-1) == -np.inf
9495

95-
# Test invalid values
96-
assert logp_fn(np.array([0])) == -np.inf # Value must be > 0
96+
# Check mu/lam restrictions
97+
with pytest.raises(ValueError):
98+
logp_fn(1, mu=1, lam=2)
9799

98-
with pytest.raises(TypeError):
99-
logp_fn(np.array([1.5])) # Value must be integer
100+
with pytest.raises(ValueError):
101+
logp_fn(1, mu=0, lam=0)
102+
103+
with pytest.raises(ParameterValueError):
104+
logp_fn(1, mu=1, lam=-1)
100105

101106
def test_logp_lam_expected_moments(self):
102107
mu = 30

0 commit comments

Comments
 (0)