Skip to content

Commit 7eb78a7

Browse files
Don't match ValueError message because some distributions use different texts
1 parent eb0fcf8 commit 7eb78a7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pymc3/tests/test_distributions_random.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,10 @@ def test_scalar_distribution_shape(self, shape, size):
265265
expected == actual
266266
), f"Sample size {size} from {shape}-shaped RV had shape {actual}. Expected: {expected}"
267267
# check that negative size raises an error
268-
with pytest.raises(ValueError, match="not allowed"):
269-
rv.random(size=-2)
268+
with pytest.raises(ValueError):
269+
self.sample_random_variable(rv, size=-2)
270+
with pytest.raises(ValueError):
271+
self.sample_random_variable(rv, size=(3, -2))
270272

271273
@pytest.mark.parametrize("size", [None, ()], ids=str)
272274
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)