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

Method test_rng_zero_and_extremes

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

Source from the content-addressed store, hash-verified

295 assert_raises(ValueError, self.rfunc, 1, 0, dtype=dt)
296
297 def test_rng_zero_and_extremes(self):
298 for dt in self.itype:
299 lbnd = 0 if dt is np.bool_ else np.iinfo(dt).min
300 ubnd = 2 if dt is np.bool_ else np.iinfo(dt).max + 1
301
302 tgt = ubnd - 1
303 assert_equal(self.rfunc(tgt, tgt + 1, size=1000, dtype=dt), tgt)
304
305 tgt = lbnd
306 assert_equal(self.rfunc(tgt, tgt + 1, size=1000, dtype=dt), tgt)
307
308 tgt = (lbnd + ubnd)//2
309 assert_equal(self.rfunc(tgt, tgt + 1, size=1000, dtype=dt), tgt)
310
311 def test_full_range(self):
312 # Test for ticket #1690

Callers

nothing calls this directly

Calls 1

assert_equalFunction · 0.90

Tested by

no test coverage detected