Skip to content

Commit fd1bfb7

Browse files
committed
improving test coverage
Signed-off-by: Nathaniel <[email protected]>
1 parent 4577106 commit fd1bfb7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

causalpy/tests/test_integration_pymc_examples.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,10 @@ def test_iv_reg_vs_prior(mock_pymc_sample):
710710
result.idata, "beta_z"
711711
)
712712
assert isinstance(summary, pd.DataFrame)
713+
with pytest.raises(ValueError):
714+
summary = result.model.vs_prior_outcome.get_shrinkage_factors(
715+
result.idata, "beta_z"
716+
)
713717

714718

715719
@pytest.mark.integration
@@ -745,6 +749,10 @@ def test_iv_reg_vs_prior_hs(mock_pymc_sample):
745749
result.idata, "beta_z"
746750
)
747751
assert isinstance(summary, pd.DataFrame)
752+
with pytest.raises(ValueError):
753+
summary = result.model.vs_prior_outcome.get_inclusion_probabilities(
754+
result.idata, "beta_z"
755+
)
748756

749757

750758
@pytest.mark.integration

causalpy/tests/test_variable_selection_priors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_create_variable_in_model_context_horseshoe(coords):
7878

7979
def test_create_prior_spike_and_slab(coords):
8080
"""Test create_prior for spike-and-slab."""
81-
vs_prior = VariableSelectionPrior("spike_and_slab")
81+
vs_prior = VariableSelectionPrior("spike_and_slab", hyperparams={"pi_alpha": 5})
8282

8383
with pm.Model(coords=coords) as model:
8484
beta = vs_prior.create_prior(name="beta", n_params=5, dims="features")

0 commit comments

Comments
 (0)