Skip to content

Commit fa4bdb8

Browse files
committed
Add skipif for betabinom depending on scipy version
1 parent d52ae50 commit fa4bdb8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pymc3/tests/test_distributions_random.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import scipy.stats as st
2626

2727
from numpy.testing import assert_almost_equal, assert_array_almost_equal
28+
from packaging.version import parse
29+
from scipy import __version__ as scipy_version
2830
from scipy.special import expit
2931

3032
import pymc3 as pm
@@ -54,6 +56,8 @@
5456
product,
5557
)
5658

59+
SCIPY_VERSION = parse(scipy_version)
60+
5761

5862
def pymc3_random(
5963
dist,
@@ -886,13 +890,19 @@ def seeded_weibul_rng_fn(self):
886890
]
887891

888892

893+
@pytest.mark.skipif(
894+
condition=(SCIPY_VERSION < parse("1.4.0")),
895+
reason="betabinom is new in Scipy 1.4.0",
896+
)
889897
class TestBetaBinomial(BaseTestDistribution):
890898
pymc_dist = pm.BetaBinomial
891899
pymc_dist_params = {"alpha": 2.0, "beta": 1.0, "n": 5}
892900
expected_rv_op_params = {"n": 5, "alpha": 2.0, "beta": 1.0}
893901
reference_dist_params = {"n": 5, "a": 2.0, "b": 1.0}
902+
reference_dist = seeded_scipy_distribution_builder("betabinom")
894903
tests_to_run = [
895904
"check_pymc_params_match_rv_op",
905+
"check_pymc_draws_match_reference",
896906
"check_rv_size",
897907
]
898908

0 commit comments

Comments
 (0)