File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 19
19
import pytest
20
20
import scipy .stats
21
21
22
+ from pymc .logprob .utils import ParameterValueError
22
23
from pymc .testing import (
23
24
BaseTestDistributionRandom ,
24
25
Domain ,
@@ -92,11 +93,15 @@ def test_logp_matches_poisson(self):
92
93
logp_fn (- 1 , mu = 5 , lam = 0 ) == - np .inf
93
94
logp_fn (9 , mu = 5 , lam = - 1 ) == - np .inf
94
95
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 )
97
99
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 )
100
105
101
106
def test_logp_lam_expected_moments (self ):
102
107
mu = 30
You can’t perform that action at this time.
0 commit comments