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

Method test_decimal

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

Source from the content-addressed store, hash-verified

511 assert approx(x, rel=5e-7, abs=0) != a
512
513 def test_decimal(self):
514 within_1e6 = [
515 (Decimal("1.000001"), Decimal("1.0")),
516 (Decimal("-1.000001"), Decimal("-1.0")),
517 ]
518 for a, x in within_1e6:
519 assert a == approx(x)
520 assert a == approx(x, rel=Decimal("5e-6"), abs=0)
521 assert a != approx(x, rel=Decimal("5e-7"), abs=0)
522 assert approx(x, rel=Decimal("5e-6"), abs=0) == a
523 assert approx(x, rel=Decimal("5e-7"), abs=0) != a
524
525 def test_fraction(self):
526 within_1e6 = [

Callers

nothing calls this directly

Calls 1

approxFunction · 0.90

Tested by

no test coverage detected