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

Method test_fraction

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

Source from the content-addressed store, hash-verified

712 self.assertEqual(statistics._exact_ratio(i), (i, 1))
713
714 def test_fraction(self):
715 numerators = (-5, 1, 12, 38)
716 for n in numerators:
717 f = Fraction(n, 37)
718 self.assertEqual(statistics._exact_ratio(f), (n, 37))
719
720 def test_float(self):
721 self.assertEqual(statistics._exact_ratio(0.125), (1, 8))

Callers

nothing calls this directly

Calls 2

FractionClass · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected