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

Method test_list

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

Source from the content-addressed store, hash-verified

547 assert approx(x, rel=5e-7, abs=0) != a
548
549 def test_list(self):
550 actual = [1 + 1e-7, 2 + 1e-8]
551 expected = [1, 2]
552
553 # Return false if any element is outside the tolerance.
554 assert actual == approx(expected, rel=5e-7, abs=0)
555 assert actual != approx(expected, rel=5e-8, abs=0)
556 assert approx(expected, rel=5e-7, abs=0) == actual
557 assert approx(expected, rel=5e-8, abs=0) != actual
558
559 def test_list_decimal(self):
560 actual = [Decimal("1.000001"), Decimal("2.000001")]

Callers

nothing calls this directly

Calls 1

approxFunction · 0.90

Tested by

no test coverage detected