mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
test: Check for installed Python module with Vimscript function.
Use the existing Vimscript function provider#pythonx#Detect() to determine whether the Neovim Python module is installed and Python 2/3 tests can be run.
This commit is contained in:
@@ -1,19 +1,19 @@
|
|||||||
do
|
|
||||||
local proc = io.popen(
|
|
||||||
[[python3 -c 'import neovim, sys; sys.stdout.write("ok")' 2> /dev/null]])
|
|
||||||
if proc:read() ~= 'ok' then
|
|
||||||
pending(
|
|
||||||
'python3 (or the python3 neovim module) is broken or missing',
|
|
||||||
function() end)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local helpers = require('test.functional.helpers')
|
local helpers = require('test.functional.helpers')
|
||||||
local eval, command, feed = helpers.eval, helpers.command, helpers.feed
|
local eval, command, feed = helpers.eval, helpers.command, helpers.feed
|
||||||
local eq, clear, insert = helpers.eq, helpers.clear, helpers.insert
|
local eq, clear, insert = helpers.eq, helpers.clear, helpers.insert
|
||||||
local expect, write_file = helpers.expect, helpers.write_file
|
local expect, write_file = helpers.expect, helpers.write_file
|
||||||
|
|
||||||
|
do
|
||||||
|
command('let [g:interp, g:errors] = provider#pythonx#Detect(3)')
|
||||||
|
local errors = eval('g:errors')
|
||||||
|
if errors ~= '' then
|
||||||
|
pending(
|
||||||
|
'Python 3 (or the Python 3 neovim module) is broken or missing:\n' .. errors,
|
||||||
|
function() end)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe('python3 commands and functions', function()
|
describe('python3 commands and functions', function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear()
|
clear()
|
||||||
|
@@ -1,19 +1,19 @@
|
|||||||
do
|
|
||||||
local proc = io.popen(
|
|
||||||
[[python -c 'import neovim, sys; sys.stdout.write("ok")' 2> /dev/null]])
|
|
||||||
if proc:read() ~= 'ok' then
|
|
||||||
pending(
|
|
||||||
'python (or the python neovim module) is broken or missing',
|
|
||||||
function() end)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local helpers = require('test.functional.helpers')
|
local helpers = require('test.functional.helpers')
|
||||||
local eval, command, feed = helpers.eval, helpers.command, helpers.feed
|
local eval, command, feed = helpers.eval, helpers.command, helpers.feed
|
||||||
local eq, clear, insert = helpers.eq, helpers.clear, helpers.insert
|
local eq, clear, insert = helpers.eq, helpers.clear, helpers.insert
|
||||||
local expect, write_file = helpers.expect, helpers.write_file
|
local expect, write_file = helpers.expect, helpers.write_file
|
||||||
|
|
||||||
|
do
|
||||||
|
command('let [g:interp, g:errors] = provider#pythonx#Detect(2)')
|
||||||
|
local errors = eval('g:errors')
|
||||||
|
if errors ~= '' then
|
||||||
|
pending(
|
||||||
|
'Python 2 (or the Python 2 neovim module) is broken or missing:\n' .. errors,
|
||||||
|
function() end)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe('python commands and functions', function()
|
describe('python commands and functions', function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear()
|
clear()
|
||||||
|
Reference in New Issue
Block a user