minor: rewrite/expand show_documentation (#980)

* minor: rewrite/expand show_documentation

* tests: improve 'documentation docstrings'
This commit is contained in:
Daniel Hahler
2020-01-17 13:48:22 +01:00
committed by GitHub
parent e2abec21c5
commit e8790b1d8f
2 changed files with 21 additions and 4 deletions

View File

@@ -15,7 +15,16 @@ describe 'documentation docstrings'
normal GK
Expect bufname('%') == "__doc__"
Expect &filetype == 'rst'
let content = join(getline(1,'$'), "\n")
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[1] == "==========================================="
else
Expect header[0] == "Docstring for builtins:class ImportError"
Expect header[1] == "========================================"
endif
let content = join(getline(3, '$'), "\n")
Expect stridx(content, "Import can't find module") > 0
normal K
Expect bufname('%') == ''