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

Method test_nan

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

Source from the content-addressed store, hash-verified

778 self.assertEqual(statistics._exact_ratio(-inf), (-inf, None))
779
780 def test_nan(self):
781 # Test that NANs are handled correctly.
782 for nan in (Decimal('NAN'), Decimal('sNAN')):
783 num, den = statistics._exact_ratio(nan)
784 # Because NANs always compare non-equal, we cannot use assertEqual.
785 # Nor can we use an identity test, as we don't guarantee anything
786 # about the object identity.
787 self.assertTrue(_nan_equal(num, nan))
788 self.assertIs(den, None)
789
790 def test_sign(self):
791 # Test sign is calculated correctly.

Callers

nothing calls this directly

Calls 4

DecimalClass · 0.90
_nan_equalFunction · 0.85
assertTrueMethod · 0.80
assertIsMethod · 0.45

Tested by

no test coverage detected