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

Method test_tuple

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

Source from the content-addressed store, hash-verified

567 assert [1, 2] != approx([1, 2, 3])
568
569 def test_tuple(self):
570 actual = (1 + 1e-7, 2 + 1e-8)
571 expected = (1, 2)
572
573 # Return false if any element is outside the tolerance.
574 assert actual == approx(expected, rel=5e-7, abs=0)
575 assert actual != approx(expected, rel=5e-8, abs=0)
576 assert approx(expected, rel=5e-7, abs=0) == actual
577 assert approx(expected, rel=5e-8, abs=0) != actual
578
579 def test_tuple_wrong_len(self):
580 assert (1, 2) != approx((1,))

Callers

nothing calls this directly

Calls 1

approxFunction · 0.90

Tested by

no test coverage detected