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

Method test_saverestore

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

Source from the content-addressed store, hash-verified

43 self.assertNotEqual(state1, state2)
44
45 def test_saverestore(self):
46 N = 1000
47 self.gen.seed()
48 state = self.gen.getstate()
49 randseq = self.randomlist(N)
50 self.gen.setstate(state) # should regenerate the same sequence
51 self.assertEqual(randseq, self.randomlist(N))
52
53 def test_seedargs(self):
54 # Seed value with a negative hash.

Callers

nothing calls this directly

Calls 5

randomlistMethod · 0.95
seedMethod · 0.45
getstateMethod · 0.45
setstateMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected