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

Method test_random_integers_max_int

numpy/random/tests/test_random.py:336–349  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

334 assert_array_equal(actual, desired)
335
336 def test_random_integers_max_int(self):
337 # Tests whether random_integers can generate the
338 # maximum allowed Python int that can be converted
339 # into a C long. Previous implementations of this
340 # method have thrown an OverflowError when attempting
341 # to generate this integer.
342 with suppress_warnings() as sup:
343 w = sup.record(DeprecationWarning)
344 actual = np.random.random_integers(np.iinfo('l').max,
345 np.iinfo('l').max)
346 assert_(len(w) == 1)
347
348 desired = np.iinfo('l').max
349 assert_equal(actual, desired)
350
351 def test_random_integers_deprecated(self):
352 with warnings.catch_warnings():

Callers

nothing calls this directly

Calls 4

suppress_warningsClass · 0.90
assert_Function · 0.90
assert_equalFunction · 0.90
recordMethod · 0.80

Tested by

no test coverage detected