MCPcopy
hub / github.com/pytest-dev/pytest / test_zero_tolerance

Method test_zero_tolerance

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

Source from the content-addressed store, hash-verified

448 assert op(a, approx(x))
449
450 def test_zero_tolerance(self):
451 within_1e10 = [(1.1e-100, 1e-100), (-1.1e-100, -1e-100)]
452 for a, x in within_1e10:
453 assert x == approx(x, rel=0.0, abs=0.0)
454 assert a != approx(x, rel=0.0, abs=0.0)
455 assert a == approx(x, rel=0.0, abs=5e-101)
456 assert a != approx(x, rel=0.0, abs=5e-102)
457 assert a == approx(x, rel=5e-1, abs=0.0)
458 assert a != approx(x, rel=5e-2, abs=0.0)
459
460 @pytest.mark.parametrize(
461 ("rel", "abs"),

Callers

nothing calls this directly

Calls 1

approxFunction · 0.90

Tested by

no test coverage detected