Skip to content

Commit

Permalink
Add match for divide by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfeickert committed Feb 10, 2022
1 parent 989bb55 commit 643ae54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def test_pdf_calculations_pytorch(backend):
assert tb.tolist(
tb.poisson(tb.astensor([0, 0, 1, 1]), tb.astensor([0, 1, 0, 1]))
) == pytest.approx([1.0, 0.3678794503211975, 0.0, 0.3678794503211975])
with pytest.warns(RuntimeWarning):
with pytest.warns(RuntimeWarning, match="divide by zero encountered in log"):
assert tb.tolist(
tb.poisson_logpdf(tb.astensor([0, 0, 1, 1]), tb.astensor([0, 1, 0, 1]))
) == pytest.approx(
Expand Down

0 comments on commit 643ae54

Please sign in to comment.