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

Method test_random_integers

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

Source from the content-addressed store, hash-verified

477 assert_array_equal(actual, desired)
478
479 def test_random_integers(self):
480 random.seed(self.seed)
481 with suppress_warnings() as sup:
482 w = sup.record(DeprecationWarning)
483 actual = random.random_integers(-99, 99, size=(3, 2))
484 assert_(len(w) == 1)
485 desired = np.array([[31, 3],
486 [-52, 41],
487 [-48, -66]])
488 assert_array_equal(actual, desired)
489
490 random.seed(self.seed)
491 with suppress_warnings() as sup:
492 w = sup.record(DeprecationWarning)
493 actual = random.random_integers(198, size=(3, 2))
494 assert_(len(w) == 1)
495 assert_array_equal(actual, desired + 100)
496
497 def test_tomaxint(self):
498 random.seed(self.seed)

Callers

nothing calls this directly

Calls 4

suppress_warningsClass · 0.90
assert_Function · 0.90
assert_array_equalFunction · 0.90
recordMethod · 0.80

Tested by

no test coverage detected