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

Method test_randrange_step

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

Source from the content-addressed store, hash-verified

488 raises_type_error(0, 0, 1.0)
489
490 def test_randrange_step(self):
491 # bpo-42772: When stop is None, the step argument was being ignored.
492 randrange = self.gen.randrange
493 with self.assertRaises(TypeError):
494 randrange(1000, step=100)
495 with self.assertRaises(TypeError):
496 randrange(1000, None, step=100)
497 with self.assertRaises(TypeError):
498 randrange(1000, step=MyIndex(1))
499 with self.assertRaises(TypeError):
500 randrange(1000, None, step=MyIndex(1))
501
502 def test_randbelow_logic(self, _log=log, int=int):
503 # check bitcount transition points: 2**i and 2**(i+1)-1

Callers

nothing calls this directly

Calls 2

MyIndexClass · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected