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

Method test_fraction

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

Source from the content-addressed store, hash-verified

956 self.check_exact_equal(x, MyInt(17))
957
958 def test_fraction(self):
959 # Test conversions to Fraction.
960 x = statistics._convert(Fraction(95, 99), Fraction)
961 self.check_exact_equal(x, Fraction(95, 99))
962 class MyFraction(Fraction):
963 def __truediv__(self, other):
964 return self.__class__(super().__truediv__(other))
965 x = statistics._convert(Fraction(71, 13), MyFraction)
966 self.check_exact_equal(x, MyFraction(71, 13))
967
968 def test_float(self):
969 # Test conversions to float.

Callers

nothing calls this directly

Calls 3

check_exact_equalMethod · 0.95
FractionClass · 0.90
MyFractionClass · 0.85

Tested by

no test coverage detected