MCPcopy
hub / github.com/pytest-dev/pytest / test_exactly_equal

Method test_exactly_equal

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

Source from the content-addressed store, hash-verified

429 assert not (10 == approx(1, rel=1e-6, abs=1e-12))
430
431 def test_exactly_equal(self):
432 examples = [
433 (2.0, 2.0),
434 (0.1e200, 0.1e200),
435 (1.123e-300, 1.123e-300),
436 (12345, 12345.0),
437 (0.0, -0.0),
438 (345678, 345678),
439 (Decimal("1.0001"), Decimal("1.0001")),
440 (Fraction(1, 3), Fraction(-1, -3)),
441 ]
442 for a, x in examples:
443 assert a == approx(x)
444
445 def test_opposite_sign(self):
446 examples = [(eq, 1e-100, -1e-100), (ne, 1e100, -1e100)]

Callers

nothing calls this directly

Calls 1

approxFunction · 0.90

Tested by

no test coverage detected