diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-04-24 22:11:05 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-04-24 22:11:05 +0300 |
commit | 7f5e1f5ef44ca7b0cddee7ef62f932851755448b (patch) | |
tree | 3f58cd8e1121c199dab668088bbd6cd4bf41b175 /contrib/python/pytest/py3/_pytest/python_api.py | |
parent | d3dcefce22da142f53fd9af30dda58955f889e48 (diff) | |
download | ydb-7f5e1f5ef44ca7b0cddee7ef62f932851755448b.tar.gz |
intermediate changes
ref:d4b5687d4c7a66b907f70930ef85d76f209837f1
Diffstat (limited to 'contrib/python/pytest/py3/_pytest/python_api.py')
-rw-r--r-- | contrib/python/pytest/py3/_pytest/python_api.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/contrib/python/pytest/py3/_pytest/python_api.py b/contrib/python/pytest/py3/_pytest/python_api.py index ea646811dd..5fa2196192 100644 --- a/contrib/python/pytest/py3/_pytest/python_api.py +++ b/contrib/python/pytest/py3/_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) @@ -573,7 +572,7 @@ def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: >>> {'a': 0.1 + 0.2, 'b': 0.2 + 0.4} == approx({'a': 0.3, 'b': 0.6}) True - The comparision will be true if both mappings have the same keys and their + The comparison will be true if both mappings have the same keys and their respective values match the expected tolerances. **Tolerances** |