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

Method test_getrandbits

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

Source from the content-addressed store, hash-verified

816 self.gen.seed(seed)
817
818 def test_getrandbits(self):
819 super().test_getrandbits()
820
821 # Verify cross-platform repeatability
822 self.gen.seed(1234567)
823 self.assertEqual(self.gen.getrandbits(100),
824 97904845777343510404718956115)
825 self.gen.seed(1234567)
826 self.assertEqual(self.gen.getrandbits(MyIndex(100)),
827 97904845777343510404718956115)
828
829 def test_getrandbits_2G_bits(self):
830 size = 2**31

Callers

nothing calls this directly

Calls 6

superClass · 0.85
MyIndexClass · 0.70
test_getrandbitsMethod · 0.45
seedMethod · 0.45
assertEqualMethod · 0.45
getrandbitsMethod · 0.45

Tested by

no test coverage detected