From bf127a63b2583b2c899fcaa4a38061e590711e21 Mon Sep 17 00:00:00 2001 From: Kale Kundert Date: Fri, 27 Jul 2018 11:24:42 -0700 Subject: [PATCH] Need to iterate over the flattened array. --- src/_pytest/python_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: