aboutsummaryrefslogtreecommitdiff
path: root/test/functional/provider/python_spec.lua
diff options
context:
space:
mode:
authorFlorian Walch <florian@fwalch.com>2015-09-22 14:33:08 +0200
committerFlorian Walch <florian@fwalch.com>2015-09-27 00:03:06 +0200
commit54596396bc3310d7e35b0b74165663293e307ba8 (patch)
tree075003e9e5380d89e1aadc54bec8c3af8ca7647e /test/functional/provider/python_spec.lua
parentdbb5f41c976c33dcefad5b0ae318a6edad574f02 (diff)
downloadrneovim-54596396bc3310d7e35b0b74165663293e307ba8.tar.gz
rneovim-54596396bc3310d7e35b0b74165663293e307ba8.tar.bz2
rneovim-54596396bc3310d7e35b0b74165663293e307ba8.zip
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.
Diffstat (limited to 'test/functional/provider/python_spec.lua')
-rw-r--r--test/functional/provider/python_spec.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/functional/provider/python_spec.lua b/test/functional/provider/python_spec.lua
index ec1a853546..f37c16a26a 100644
--- a/test/functional/provider/python_spec.lua
+++ b/test/functional/provider/python_spec.lua
@@ -1,19 +1,19 @@
+local helpers = require('test.functional.helpers')
+local eval, command, feed = helpers.eval, helpers.command, helpers.feed
+local eq, clear, insert = helpers.eq, helpers.clear, helpers.insert
+local expect, write_file = helpers.expect, helpers.write_file
+
do
- local proc = io.popen(
- [[python -c 'import neovim, sys; sys.stdout.write("ok")' 2> /dev/null]])
- if proc:read() ~= 'ok' then
+ command('let [g:interp, g:errors] = provider#pythonx#Detect(2)')
+ local errors = eval('g:errors')
+ if errors ~= '' then
pending(
- 'python (or the python neovim module) is broken or missing',
+ 'Python 2 (or the Python 2 neovim module) is broken or missing:\n' .. errors,
function() end)
return
end
end
-local helpers = require('test.functional.helpers')
-local eval, command, feed = helpers.eval, helpers.command, helpers.feed
-local eq, clear, insert = helpers.eq, helpers.clear, helpers.insert
-local expect, write_file = helpers.expect, helpers.write_file
-
describe('python commands and functions', function()
before_each(function()
clear()