MCPcopy Create free account
hub / github.com/numpy/numpy / test_get_state_warning

Method test_get_state_warning

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

Source from the content-addressed store, hash-verified

235 self.random_state.negative_binomial(0.5, 0.5)
236
237 def test_get_state_warning(self):
238 rs = random.RandomState(PCG64())
239 with suppress_warnings() as sup:
240 w = sup.record(RuntimeWarning)
241 state = rs.get_state()
242 assert_(len(w) == 1)
243 assert isinstance(state, dict)
244 assert state['bit_generator'] == 'PCG64'
245
246 def test_invalid_legacy_state_setting(self):
247 state = self.random_state.get_state()

Callers

nothing calls this directly

Calls 3

suppress_warningsClass · 0.90
assert_Function · 0.90
recordMethod · 0.80

Tested by

no test coverage detected