MCPcopy Index your code
hub / github.com/python/cpython / test_inf

Method test_inf

Lib/test/test_statistics.py:592–600  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

590 # Test approx_equal with NANs and INFs and zeroes.
591
592 def test_inf(self):
593 for type_ in (float, Decimal):
594 inf = type_('inf')
595 self.assertTrue(approx_equal(inf, inf))
596 self.assertTrue(approx_equal(inf, inf, 0, 0))
597 self.assertTrue(approx_equal(inf, inf, 1, 0.01))
598 self.assertTrue(approx_equal(-inf, -inf))
599 self.assertFalse(approx_equal(inf, -inf))
600 self.assertFalse(approx_equal(inf, 1000))
601
602 def test_nan(self):
603 for type_ in (float, Decimal):

Callers

nothing calls this directly

Calls 3

approx_equalFunction · 0.85
assertTrueMethod · 0.80
assertFalseMethod · 0.80

Tested by

no test coverage detected