mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +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( | ||||
|     [[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 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 | ||||
|   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() | ||||
|   before_each(function() | ||||
|     clear() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Florian Walch
					Florian Walch