diff options
author | w0rp <devw0rp@gmail.com> | 2017-09-09 13:28:46 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-09-09 13:28:46 +0100 |
commit | 574cb1159416954a497dfb3954bb91fd838ab4eb (patch) | |
tree | f28ce2f22d1c966333d84db0cd29a3f0272870b6 /test/command_callback/test_flake8_command_callback.vader | |
parent | d9bdbd5a58faa1547fbeccc53a69bd0846628243 (diff) | |
download | ale-574cb1159416954a497dfb3954bb91fd838ab4eb.zip |
#917 Cover the old _args option for flake8 with a test, just in case
Diffstat (limited to 'test/command_callback/test_flake8_command_callback.vader')
-rw-r--r-- | test/command_callback/test_flake8_command_callback.vader | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/test/command_callback/test_flake8_command_callback.vader b/test/command_callback/test_flake8_command_callback.vader index c36fe4f5..c564b54f 100644 --- a/test/command_callback/test_flake8_command_callback.vader +++ b/test/command_callback/test_flake8_command_callback.vader @@ -1,14 +1,23 @@ Before: + Save g:ale_python_flake8_executable + Save g:ale_python_flake8_options + Save g:ale_python_flake8_use_global + + unlet! g:ale_python_flake8_executable + unlet! g:ale_python_flake8_args + unlet! g:ale_python_flake8_options + unlet! g:ale_python_flake8_use_global + runtime ale_linters/python/flake8.vim call ale#test#SetDirectory('/testplugin/test/command_callback') After: + Restore + + unlet! g:ale_python_flake8_args + call ale#test#RestoreDirectory() call ale#linter#Reset() - let g:ale_python_flake8_executable = 'flake8' - let g:ale_python_flake8_options = '' - let g:ale_python_flake8_use_global = 0 - call ale_linters#python#flake8#ClearVersionCache() Execute(The flake8 callbacks should return the correct default values): @@ -131,3 +140,25 @@ Execute(Using `python -m flake8` should be supported for running flake8): AssertEqual \ '''python'' -m flake8 --some-option --format=default -', \ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9']) + +Execute(Using `python2 -m flake8` should be use with the old args option): + let g:ale_python_flake8_executable = 'python2' + let g:ale_python_flake8_args = '-m flake8' + let g:ale_python_flake8_use_global = 0 + + unlet! g:ale_python_flake8_options + + call ale#linter#Reset() + runtime ale_linters/python/flake8.vim + + silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py') + + AssertEqual + \ 'python2', + \ ale_linters#python#flake8#GetExecutable(bufnr('')) + AssertEqual + \ '''python2'' -m flake8 --version', + \ ale_linters#python#flake8#VersionCheck(bufnr('')) + AssertEqual + \ '''python2'' -m flake8 --format=default -', + \ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9']) |