Skip to content

Commit a7fe08c

Browse files
author
Goose
committed
add test for predictive variable only
1 parent 2d2c46c commit a7fe08c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/sampling/test_forward.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,11 +862,18 @@ def test_logging_sampled_basic_rvs_prior(self, caplog):
862862
assert caplog.record_tuples == [("pymc.sampling.forward", logging.INFO, "Sampling: [x, z]")]
863863
caplog.clear()
864864

865+
# RV only
865866
with m:
866867
pm.sample_prior_predictive(draws=1, var_names=["x"])
867868
assert caplog.record_tuples == [("pymc.sampling.forward", logging.INFO, "Sampling: [x]")]
868869
caplog.clear()
869870

871+
# observed only
872+
with m:
873+
pm.sample_prior_predictive(draws=1, var_names=["z"])
874+
assert caplog.record_tuples == [("pymc.sampling.forward", logging.INFO, "Sampling: [z]")]
875+
caplog.clear()
876+
870877
def test_logging_sampled_basic_rvs_posterior(self, caplog):
871878
with pm.Model() as m:
872879
x = pm.Normal("x")

0 commit comments

Comments
 (0)