Skip to content

Commit

Permalink
Add unit test for warn_missing_rvs=False
Browse files Browse the repository at this point in the history
  • Loading branch information
larryshamalama committed Jul 5, 2022
1 parent ee7ad4d commit b82d518
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tests/test_joint_logprob.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import warnings

import aesara
import aesara.tensor as at
import numpy as np
Expand Down Expand Up @@ -261,6 +263,10 @@ def test_warn_random_not_found():
with pytest.warns(UserWarning):
factorized_joint_logprob({y_rv: y_vv})

with warnings.catch_warnings():
warnings.simplefilter("error")
factorized_joint_logprob({y_rv: y_vv}, warn_missing_rvs=False)


def test_multiple_rvs_to_same_value_raises():
x_rv1 = at.random.normal(name="x1")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def scan_fn(mus_t, sigma_t, Y_t_val, S_t_val, Gamma_t):
assert np.allclose(y_logp_val, y_logp_ref_val)


@aesara.config.change_flags(compute_test_value="raise")
@pytest.mark.xfail(reason="see #148")
def test_initial_values():
srng = at.random.RandomStream(seed=2320)

Expand Down

0 comments on commit b82d518

Please sign in to comment.