mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-06 10:54:22 +08:00
Fix documentation tests
This commit is contained in:
@@ -251,7 +251,8 @@ def choose_environment():
|
||||
vim_command('belowright new')
|
||||
vim.current.buffer[:] = env_paths
|
||||
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> <CR> :PythonJedi jedi_vim.choose_environment_hit_enter()<CR>')
|
||||
|
||||
@@ -744,7 +745,7 @@ def show_documentation():
|
||||
for n in names:
|
||||
doc = n.docstring()
|
||||
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)
|
||||
docs.append('%s\n%s\n%s' % (title, underline, doc))
|
||||
else:
|
||||
|
||||
@@ -18,10 +18,10 @@ describe 'documentation docstrings'
|
||||
let header = getline(1, 2)
|
||||
PythonJedi vim.vars["is_py2"] = sys.version_info[0] == 2
|
||||
if g:is_py2
|
||||
Expect header[0] == "Docstring for __builtin__:class ImportError"
|
||||
Expect header[0] == "Docstring for class __builtin__.ImportError"
|
||||
Expect header[1] == "==========================================="
|
||||
else
|
||||
Expect header[0] == "Docstring for builtins:class ImportError"
|
||||
Expect header[0] == "Docstring for class builtins.ImportError"
|
||||
Expect header[1] == "========================================"
|
||||
endif
|
||||
let content = join(getline(3, '$'), "\n")
|
||||
|
||||
Reference in New Issue
Block a user