Skip to content

Commit c014fba

Browse files
Disable asserts during logp invalid range tests
1 parent 735278a commit c014fba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pymc3/tests/test_distributions.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,12 @@ def check_logcdf(
745745
if invalid_edge is not None:
746746
test_params = valid_params.copy() # Shallow copy should be okay
747747
test_params[invalid_param] = invalid_edge
748-
invalid_dist = pymc3_dist.dist(**test_params)
748+
# We need to remove `Assert`s introduced by checks like
749+
# `assert_negative_support` and disable test values;
750+
# otherwise, we won't be able to create the
751+
# `RandomVariable`
752+
with aesara.config.change_flags(compute_test_value="off"):
753+
invalid_dist = pymc3_dist.dist(no_assert=True, **test_params)
749754
with aesara.config.change_flags(mode=Mode("py")):
750755
assert_equal(
751756
logcdf(invalid_dist, valid_value).eval(),

0 commit comments

Comments
 (0)