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

Method test_size

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

Source from the content-addressed store, hash-verified

145 assert_(np.all(x < -1))
146
147 def test_size(self):
148 # gh-3173
149 p = [0.5, 0.5]
150 assert_equal(random.multinomial(1, p, np.uint32(1)).shape, (1, 2))
151 assert_equal(random.multinomial(1, p, np.uint32(1)).shape, (1, 2))
152 assert_equal(random.multinomial(1, p, np.uint32(1)).shape, (1, 2))
153 assert_equal(random.multinomial(1, p, [2, 2]).shape, (2, 2, 2))
154 assert_equal(random.multinomial(1, p, (2, 2)).shape, (2, 2, 2))
155 assert_equal(random.multinomial(1, p, np.array((2, 2))).shape,
156 (2, 2, 2))
157
158 assert_raises(TypeError, random.multinomial, 1, p,
159 float(1))
160
161 def test_invalid_prob(self):
162 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