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

Method test_fraction

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

Source from the content-addressed store, hash-verified

523 assert approx(x, rel=Decimal("5e-7"), abs=0) != a
524
525 def test_fraction(self):
526 within_1e6 = [
527 (1 + Fraction(1, 1000000), Fraction(1)),
528 (-1 - Fraction(-1, 1000000), Fraction(-1)),
529 ]
530 for a, x in within_1e6:
531 assert a == approx(x, rel=5e-6, abs=0)
532 assert a != approx(x, rel=5e-7, abs=0)
533 assert approx(x, rel=5e-6, abs=0) == a
534 assert approx(x, rel=5e-7, abs=0) != a
535
536 def test_complex(self):
537 within_1e6 = [

Callers

nothing calls this directly

Calls 1

approxFunction · 0.90

Tested by

no test coverage detected