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

Method test_exactly_equal

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

Source from the content-addressed store, hash-verified

332 assert not (10 == approx(1, rel=1e-6, abs=1e-12))
333
334 def test_exactly_equal(self):
335 examples = [
336 (2.0, 2.0),
337 (0.1e200, 0.1e200),
338 (1.123e-300, 1.123e-300),
339 (12345, 12345.0),
340 (0.0, -0.0),
341 (345678, 345678),
342 (Decimal("1.0001"), Decimal("1.0001")),
343 (Fraction(1, 3), Fraction(-1, -3)),
344 ]
345 for a, x in examples:
346 assert a == approx(x)
347
348 def test_opposite_sign(self):
349 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