From 2c157e323e2c4f0a57809837a52774559d10818e Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 1 Aug 2020 00:12:24 +0200 Subject: [PATCH] Fix documentation tests --- pythonx/jedi_vim.py | 5 +++-- test/vspec/documentation.vim | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pythonx/jedi_vim.py b/pythonx/jedi_vim.py index ea6f033..8606d2b 100644 --- a/pythonx/jedi_vim.py +++ b/pythonx/jedi_vim.py @@ -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 :bw') vim_command('noremap :PythonJedi jedi_vim.choose_environment_hit_enter()') @@ -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: diff --git a/test/vspec/documentation.vim b/test/vspec/documentation.vim index 074e608..948d12d 100644 --- a/test/vspec/documentation.vim +++ b/test/vspec/documentation.vim @@ -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")