Skip to content

Commit

Permalink
fix(tests): "provider#python3#Prog" was removed upstream
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
justinmk committed Mar 16, 2024
1 parent 5f989df commit d18a007
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/test_vim.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,11 @@ def test_hash(vim: Nvim) -> None:

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

assert sys.executable == vim.command_output(
'python3 import sys; print(sys.executable)')
Expand Down

0 comments on commit d18a007

Please sign in to comment.