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

Method test_autoseed

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

Source from the content-addressed store, hash-verified

35 return [self.gen.random() for i in range(n)]
36
37 def test_autoseed(self):
38 self.gen.seed()
39 state1 = self.gen.getstate()
40 time.sleep(0.1)
41 self.gen.seed() # different seeds at different times
42 state2 = self.gen.getstate()
43 self.assertNotEqual(state1, state2)
44
45 def test_saverestore(self):
46 N = 1000

Callers

nothing calls this directly

Calls 4

assertNotEqualMethod · 0.80
seedMethod · 0.45
getstateMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected