Fix recursion in pytest.approx() with arrays in numpy<1.13
This commit is contained in:
parent
4588130c1e
commit
7d13599ba1
|
@ -0,0 +1 @@
|
|||
Fix infinite recursion in ``pytest.approx`` with arrays in ``numpy<1.13``.
|
|
@ -211,7 +211,7 @@ class ApproxScalar(ApproxBase):
|
|||
the pre-specified tolerance.
|
||||
"""
|
||||
if _is_numpy_array(actual):
|
||||
return all(a == self for a in actual.flat)
|
||||
return all(self == a for a in actual.flat)
|
||||
|
||||
# Short-circuit exact equality.
|
||||
if actual == self.expected:
|
||||
|
|
Loading…
Reference in New Issue