diff options
Diffstat (limited to 'test/linter/test_pyright.vader')
-rw-r--r-- | test/linter/test_pyright.vader | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/linter/test_pyright.vader b/test/linter/test_pyright.vader index 303efa24..c81ab4b4 100644 --- a/test/linter/test_pyright.vader +++ b/test/linter/test_pyright.vader @@ -1,10 +1,13 @@ Before: call ale#assert#SetUpLinterTest('python', 'pyright') + Save b:ale_python_auto_virtualenv let b:bin_dir = has('win32') ? 'Scripts' : 'bin' After: unlet! b:bin_dir + unlet! b:venv_bin + unlet! b:sep unlet! b:executable call ale#assert#TearDownLinterTest() @@ -132,6 +135,17 @@ Execute(The pyright callbacks should detect virtualenv directories): AssertLinter b:executable, ale#Escape(b:executable) . ' --stdio' +Execute(virtualenv vars should be used when ale_python_auto_virtualenv = 1): + let b:ale_python_auto_virtualenv = 1 + call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py') + + let b:venv_bin = ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir) + let b:sep = has('win32') ? ';' : ':' + let b:executable = ale#path#Simplify(b:venv_bin . '/pyright-langserver') + + AssertLinter b:executable, ale#Env('PATH', b:venv_bin . b:sep . $PATH) + \ . ale#Escape(b:executable) . ' --stdio' + Execute(Setting executable to 'pipenv' should append 'run pyright'): call ale#test#SetFilename('../test-files') |