MCPcopy
hub / github.com/numpy/numpy / test_size

Method test_size

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

Source from the content-addressed store, hash-verified

149 assert_(np.all(x < -1))
150
151 def test_size(self):
152 # gh-3173
153 p = [0.5, 0.5]
154 assert_equal(random.multinomial(1, p, np.uint32(1)).shape, (1, 2))
155 assert_equal(random.multinomial(1, p, np.uint32(1)).shape, (1, 2))
156 assert_equal(random.multinomial(1, p, np.uint32(1)).shape, (1, 2))
157 assert_equal(random.multinomial(1, p, [2, 2]).shape, (2, 2, 2))
158 assert_equal(random.multinomial(1, p, (2, 2)).shape, (2, 2, 2))
159 assert_equal(random.multinomial(1, p, np.array((2, 2))).shape,
160 (2, 2, 2))
161
162 assert_raises(TypeError, random.multinomial, 1, p,
163 float(1))
164
165 def test_invalid_prob(self):
166 assert_raises(ValueError, random.multinomial, 100, [1.1, 0.2])

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
assert_raisesFunction · 0.90

Tested by

no test coverage detected