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

Method test_no_p_overwrite

numpy/lib/tests/test_function_base.py:3638–3648  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3636 assert_raises(TypeError, np.quantile, arr_c, 0.5)
3637
3638 def test_no_p_overwrite(self):
3639 # this is worth retesting, because quantile does not make a copy
3640 p0 = np.array([0, 0.75, 0.25, 0.5, 1.0])
3641 p = p0.copy()
3642 np.quantile(np.arange(100.), p, method="midpoint")
3643 assert_array_equal(p, p0)
3644
3645 p0 = p0.tolist()
3646 p = p.tolist()
3647 np.quantile(np.arange(100.), p, method="midpoint")
3648 assert_array_equal(p, p0)
3649
3650 @pytest.mark.parametrize("dtype", np.typecodes["AllInteger"])
3651 def test_quantile_preserve_int_type(self, dtype):

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
copyMethod · 0.45
tolistMethod · 0.45

Tested by

no test coverage detected