Add tolerances to complex values when printing pytest.approx
.
For example, repr(pytest.approx(3+4j))
returns (3+4j) ± 5e-06 ∠ ±180°
. This is polar notation indicating a circle around the expected value, with a radius of 5e-06. For approx
comparisons to return True
, the actual value should fall within this circle.