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

Method test_poisson_exceptions

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

Source from the content-addressed store, hash-verified

1116 assert_array_equal(actual, desired)
1117
1118 def test_poisson_exceptions(self):
1119 lambig = np.iinfo('l').max
1120 lamneg = -1
1121 assert_raises(ValueError, random.poisson, lamneg)
1122 assert_raises(ValueError, random.poisson, [lamneg] * 10)
1123 assert_raises(ValueError, random.poisson, lambig)
1124 assert_raises(ValueError, random.poisson, [lambig] * 10)
1125 with suppress_warnings() as sup:
1126 sup.record(RuntimeWarning)
1127 assert_raises(ValueError, random.poisson, np.nan)
1128 assert_raises(ValueError, random.poisson, [np.nan] * 10)
1129
1130 def test_power(self):
1131 random.seed(self.seed)

Callers

nothing calls this directly

Calls 3

assert_raisesFunction · 0.90
suppress_warningsClass · 0.90
recordMethod · 0.80

Tested by

no test coverage detected