def METHOD_NAME(self, func, axis, out_shape):
    expected_exc = ValueError
    func_np = getattr(np, func)
    func_num = getattr(num, func)
    out_np = np.empty(out_shape)
    out_num = num.empty(out_shape)
    with pytest.raises(expected_exc):
        func_np(self.in_np, axis=axis, out=out_np)
    with pytest.raises(expected_exc):
        func_num(self.in_num, axis=axis, out=out_num)