MCPcopy
hub / github.com/numpy/numpy / test_pickle

Method test_pickle

numpy/random/tests/test_randomstate.py:265–274  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

263 assert_raises(ValueError, random_state.set_state, state)
264
265 def test_pickle(self):
266 random_state, _ = self._create_state()
267 random_state.seed(0)
268 random_state.random_sample(100)
269 random_state.standard_normal()
270 pickled = random_state.get_state(legacy=False)
271 assert_equal(pickled['has_gauss'], 1)
272 rs_unpick = pickle.loads(pickle.dumps(random_state))
273 unpickled = rs_unpick.get_state(legacy=False)
274 assert_mt19937_state_equal(pickled, unpickled)
275
276 def test_state_setting(self):
277 random_state, state = self._create_state()

Callers

nothing calls this directly

Calls 3

_create_stateMethod · 0.95
assert_equalFunction · 0.90

Tested by

no test coverage detected