Skip to content

Commit 03d5ed9

Browse files
committed
fix(tests): tests
Problem: Tests fail since upstream Nvim commit neovim/neovim@eb5d15e which removed the (internal) `provider#python3#Prog` function. pynvim.api.common.NvimError: nvim_exec2(): Vim(echomsg):E117: Unknown function: provider#python3#Prog Solution: Use the new Lua function instead.
1 parent 5f989df commit 03d5ed9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/test_vim.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,9 @@ def test_hash(vim: Nvim) -> None:
209209

210210
def test_python3(vim: Nvim) -> None:
211211
"""Tests whether python3 host can load."""
212-
python3_prog = vim.command_output('echom provider#python3#Prog()')
213-
python3_err = vim.command_output('echom provider#python3#Error()')
214-
assert python3_prog != "", python3_err
215-
assert python3_prog == sys.executable
212+
rv = vim.exec_lua('local prog, err = vim.provider.python.detect_by_module("neovim"); return { prog = prog, err = err };')
213+
assert rv['prog'] != "", rv['err']
214+
assert rv['prog'] == sys.executable
216215

217216
assert sys.executable == vim.command_output(
218217
'python3 import sys; print(sys.executable)')

0 commit comments

Comments
 (0)