Merge pull request #990 from monokrome/master

Use $VIRTUAL_ENV environment variable when present.
This commit is contained in:
w0rp 2017-10-11 22:18:22 +01:00 committed by GitHub
commit be547a0111
2 changed files with 13 additions and 1 deletions

View File

@ -71,7 +71,7 @@ function! ale#python#FindVirtualenv(buffer) abort
endfor
endfor
return ''
return $VIRTUAL_ENV
endfunction
" Run an executable check for Python scripts.

View File

@ -0,0 +1,12 @@
Before:
Save $VIRTUAL_ENV
let $VIRTUAL_ENV = "/opt/example/"
After:
Restore
Execute(ale#python#FindVirtualenv falls back to $VIRTUAL_ENV when no directories match):
AssertEqual
\ ale#python#FindVirtualenv(bufnr('%')),
\ '/opt/example/',
\ 'Expected VIRTUAL_ENV environment variable to be used, but it was not'