Skip to content

Commit eba76f6

Browse files
add tests for code-cov
1 parent 835f533 commit eba76f6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/distributions/test_multivariate.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,23 @@ def test_car_matrix_check(sparse):
835835
car_dist = pm.CAR.dist(mu, W, alpha, tau)
836836

837837

838+
@pytest.mark.parametrize("alpha", [1, -1])
839+
def test_car_alpha(alpha):
840+
"""
841+
Tests the check that -1 < alpha < 1
842+
"""
843+
844+
W = np.array([[0, 1, 0], [1, 0, 1], [0, 1, 0]])
845+
846+
tau = 1
847+
mu = np.array([0, 0, 0])
848+
849+
car_dist = pm.CAR.dist(W=W, alpha=alpha, mu=mu, tau=tau)
850+
851+
with pytest.raises(ValueError, match="the domain of alpha is: -1 < alpha < 1"):
852+
pm.draw(car_dist)
853+
854+
838855
class TestLKJCholeskCov:
839856
def test_dist(self):
840857
sd_dist = pm.Exponential.dist(1, size=(10, 3))

0 commit comments

Comments
 (0)