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

Method test_randrange_index

Lib/test/test_random.py:523–527  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

521 self.assertTrue(2**k > n > 2**(k-1)) # note the stronger assertion
522
523 def test_randrange_index(self):
524 randrange = self.gen.randrange
525 self.assertIn(randrange(MyIndex(5)), range(5))
526 self.assertIn(randrange(MyIndex(2), MyIndex(7)), range(2, 7))
527 self.assertIn(randrange(MyIndex(5), MyIndex(15), MyIndex(2)), range(5, 15, 2))
528
529 def test_randint(self):
530 randint = self.gen.randint

Callers

nothing calls this directly

Calls 2

assertInMethod · 0.80
MyIndexClass · 0.70

Tested by

no test coverage detected