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

Method test_dunder_round

numpy/core/tests/test_numeric.py:183–190  ·  view source on GitHub ↗
(self, dtype)

Source from the content-addressed store, hash-verified

181 np.float16, np.float32, np.float64,
182 ])
183 def test_dunder_round(self, dtype):
184 s = dtype(1)
185 assert_(isinstance(round(s), int))
186 assert_(isinstance(round(s, None), int))
187 assert_(isinstance(round(s, ndigits=None), int))
188 assert_equal(round(s), 1)
189 assert_equal(round(s, None), 1)
190 assert_equal(round(s, ndigits=None), 1)
191
192 @pytest.mark.parametrize('val, ndigits', [
193 pytest.param(2**31 - 1, -1,

Callers

nothing calls this directly

Calls 4

assert_Function · 0.90
assert_equalFunction · 0.90
dtypeFunction · 0.85
roundFunction · 0.50

Tested by

no test coverage detected