MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_inf_tolerance_expecting_zero

Method test_inf_tolerance_expecting_zero

testing/python/approx.py:396–402  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 1

approxFunction · 0.90

Tested by

no test coverage detected