Skip to content

Commit 3a09abb

Browse files
authored
Merge pull request #444 from rsokl/fix-test
Loosen test requirements
2 parents 4507fa7 + 8eafea6 commit 3a09abb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/math/unary/test_scipy_mirror.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
import pytest
55
from hypothesis import given, settings
6-
from numpy.testing import assert_array_equal
6+
from numpy.testing import assert_allclose
77
from scipy import special
88

99
from mygrad.math._special import logsumexp
@@ -26,9 +26,11 @@ def test_logsumexp(data: st.SearchStrategy, x: np.ndarray, keepdims: bool):
2626
axes = data.draw(valid_axes(ndim=x.ndim), label="axes")
2727
mygrad_result = logsumexp(x, axis=axes, keepdims=keepdims)
2828
scipy_result = special.logsumexp(x, axis=axes, keepdims=keepdims)
29-
assert_array_equal(
30-
mygrad_result,
31-
scipy_result,
29+
assert_allclose(
30+
actual=mygrad_result,
31+
desired=scipy_result,
3232
err_msg="mygrad's implementation of logsumexp does "
3333
"not match that of scipy's",
34+
atol=1e-8,
35+
rtol=1e-8,
3436
)

0 commit comments

Comments
 (0)