diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 6d2828a64..5331d8a84 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -211,7 +211,7 @@ class ApproxScalar(ApproxBase): the pre-specified tolerance. """ if _is_numpy_array(actual): - return all(a == self for a in actual) + return all(a == self for a in actual.flat) # Short-circuit exact equality. if actual == self.expected: