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

Method test_as_integer_ratio

Lib/test/test_long.py:1638–1646  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1636 self.assertEqual(type(value >> shift), int)
1637
1638 def test_as_integer_ratio(self):
1639 class myint(int):
1640 pass
1641 tests = [10, 0, -10, 1, sys.maxsize + 1, True, False, myint(42)]
1642 for value in tests:
1643 numerator, denominator = value.as_integer_ratio()
1644 self.assertEqual((numerator, denominator), (int(value), 1))
1645 self.assertEqual(type(numerator), int)
1646 self.assertEqual(type(denominator), int)
1647
1648 def test_square(self):
1649 # Multiplication makes a special case of multiplying an int with

Callers

nothing calls this directly

Calls 3

myintClass · 0.70
as_integer_ratioMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected