MCPcopy
hub / github.com/numpy/numpy / test_in_bounds_fuzz

Method test_in_bounds_fuzz

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

Source from the content-addressed store, hash-verified

336 f"but one was with the following message:\n\n{e}")
337
338 def test_in_bounds_fuzz(self):
339 # Don't use fixed seed
340 rng = np.random.RandomState()
341
342 for dt in self.itype[1:]:
343 for ubnd in [4, 8, 16]:
344 vals = rng.randint(2, ubnd, size=2**16, dtype=dt)
345 assert_(vals.max() < ubnd)
346 assert_(vals.min() >= 2)
347
348 vals = rng.randint(0, 2, size=2**16, dtype=np.bool)
349
350 assert_(vals.max() < 2)
351 assert_(vals.min() >= 0)
352
353 def test_repeatability(self):
354 # We use a sha256 hash of generated sequences of 1000 samples

Callers

nothing calls this directly

Calls 3

assert_Function · 0.90
maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected