diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 35560f168..200b2b3aa 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -265,7 +265,7 @@ class ApproxMapping(ApproxBase): approx_side_as_map.items(), other_side.values() ): if approx_value != other_value: - if not any((approx_value.expected is None, other_value is None)): + if approx_value.expected is not None and other_value is not None: max_abs_diff = max( max_abs_diff, abs(approx_value.expected - other_value) )