MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_as_integer_ratio

Method test_as_integer_ratio

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

Source from the content-addressed store, hash-verified

1639 self.assertEqual(type(value >> shift), int)
1640
1641 def test_as_integer_ratio(self):
1642 class myint(int):
1643 pass
1644 tests = [10, 0, -10, 1, sys.maxsize + 1, True, False, myint(42)]
1645 for value in tests:
1646 numerator, denominator = value.as_integer_ratio()
1647 self.assertEqual((numerator, denominator), (int(value), 1))
1648 self.assertEqual(type(numerator), int)
1649 self.assertEqual(type(denominator), int)
1650
1651 def test_square(self):
1652 # 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