From 7dd5c4049e9ca12bfc38c5de71c4fa33ee659528 Mon Sep 17 00:00:00 2001 From: Kian Eliasi Date: Sun, 20 Mar 2022 17:20:36 +0330 Subject: [PATCH] Remove unnecessary numpy import in ApproxSequenceLike --- src/_pytest/python_api.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index be1576133..5fa219619 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -319,7 +319,6 @@ class ApproxSequenceLike(ApproxBase): def _repr_compare(self, other_side: Sequence[float]) -> List[str]: import math - import numpy as np if len(self.expected) != len(other_side): return [ @@ -340,7 +339,7 @@ class ApproxSequenceLike(ApproxBase): abs_diff = abs(approx_value.expected - other_value) max_abs_diff = max(max_abs_diff, abs_diff) if other_value == 0.0: - max_rel_diff = np.inf + max_rel_diff = math.inf else: max_rel_diff = max(max_rel_diff, abs_diff / abs(other_value)) different_ids.append(i)