(self)
| 394 | assert a == approx(x, rel=inf, abs=inf) |
| 395 | |
| 396 | def test_inf_tolerance_expecting_zero(self) -> None: |
| 397 | # If the relative tolerance is zero but the expected value is infinite, |
| 398 | # the actual tolerance is a NaN, which should be an error. |
| 399 | with pytest.raises(ValueError): |
| 400 | 1 == approx(0, rel=inf, abs=0.0) |
| 401 | with pytest.raises(ValueError): |
| 402 | 1 == approx(0, rel=inf, abs=inf) |
| 403 | |
| 404 | def test_nan_tolerance(self) -> None: |
| 405 | with pytest.raises(ValueError): |