From d0ba242c46f2b4b08d7a02d302883b07906dcd08 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 27 Jul 2018 15:07:20 -0300 Subject: [PATCH] Implement change suggested by @kalekundert in PR --- src/_pytest/python_api.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 04022b9fe..6d2828a64 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -211,9 +211,7 @@ class ApproxScalar(ApproxBase): the pre-specified tolerance. """ if _is_numpy_array(actual): - import numpy as np - - return np.all(abs(self.expected - actual) <= self.tolerance) + return all(a == self for a in actual) # Short-circuit exact equality. if actual == self.expected: