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

Method test_zero_tolerance

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

Source from the content-addressed store, hash-verified

351 assert op(a, approx(x))
352
353 def test_zero_tolerance(self):
354 within_1e10 = [(1.1e-100, 1e-100), (-1.1e-100, -1e-100)]
355 for a, x in within_1e10:
356 assert x == approx(x, rel=0.0, abs=0.0)
357 assert a != approx(x, rel=0.0, abs=0.0)
358 assert a == approx(x, rel=0.0, abs=5e-101)
359 assert a != approx(x, rel=0.0, abs=5e-102)
360 assert a == approx(x, rel=5e-1, abs=0.0)
361 assert a != approx(x, rel=5e-2, abs=0.0)
362
363 @pytest.mark.parametrize(
364 ("rel", "abs"),

Callers

nothing calls this directly

Calls 1

approxFunction · 0.90

Tested by

no test coverage detected