forked from VimPlug/jedi-vim
Fix documentation tests
This commit is contained in:
@@ -251,7 +251,8 @@ def choose_environment():
|
|||||||
vim_command('belowright new')
|
vim_command('belowright new')
|
||||||
vim.current.buffer[:] = env_paths
|
vim.current.buffer[:] = env_paths
|
||||||
vim.current.buffer.name = "Hit Enter to Choose an Environment"
|
vim.current.buffer.name = "Hit Enter to Choose an Environment"
|
||||||
vim_command('setlocal buftype=nofile bufhidden=wipe noswapfile nobuflisted readonly nomodifiable')
|
vim_command(
|
||||||
|
'setlocal buftype=nofile bufhidden=wipe noswapfile nobuflisted readonly nomodifiable')
|
||||||
vim_command('noremap <buffer> <ESC> :bw<CR>')
|
vim_command('noremap <buffer> <ESC> :bw<CR>')
|
||||||
vim_command('noremap <buffer> <CR> :PythonJedi jedi_vim.choose_environment_hit_enter()<CR>')
|
vim_command('noremap <buffer> <CR> :PythonJedi jedi_vim.choose_environment_hit_enter()<CR>')
|
||||||
|
|
||||||
@@ -744,7 +745,7 @@ def show_documentation():
|
|||||||
for n in names:
|
for n in names:
|
||||||
doc = n.docstring()
|
doc = n.docstring()
|
||||||
if doc:
|
if doc:
|
||||||
title = 'Docstring for %s' % (n.full_name or n.name)
|
title = 'Docstring for %s %s' % (n.type, n.full_name or n.name)
|
||||||
underline = '=' * len(title)
|
underline = '=' * len(title)
|
||||||
docs.append('%s\n%s\n%s' % (title, underline, doc))
|
docs.append('%s\n%s\n%s' % (title, underline, doc))
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ describe 'documentation docstrings'
|
|||||||
let header = getline(1, 2)
|
let header = getline(1, 2)
|
||||||
PythonJedi vim.vars["is_py2"] = sys.version_info[0] == 2
|
PythonJedi vim.vars["is_py2"] = sys.version_info[0] == 2
|
||||||
if g:is_py2
|
if g:is_py2
|
||||||
Expect header[0] == "Docstring for __builtin__:class ImportError"
|
Expect header[0] == "Docstring for class __builtin__.ImportError"
|
||||||
Expect header[1] == "==========================================="
|
Expect header[1] == "==========================================="
|
||||||
else
|
else
|
||||||
Expect header[0] == "Docstring for builtins:class ImportError"
|
Expect header[0] == "Docstring for class builtins.ImportError"
|
||||||
Expect header[1] == "========================================"
|
Expect header[1] == "========================================"
|
||||||
endif
|
endif
|
||||||
let content = join(getline(3, '$'), "\n")
|
let content = join(getline(3, '$'), "\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user