diff options
author | w0rp <devw0rp@gmail.com> | 2022-12-24 13:28:08 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2022-12-24 13:37:57 +0000 |
commit | bc957015752bce79389e0092998a7b920d277670 (patch) | |
tree | 5a33a22281c203a0e036649c1279290e64005b27 /test/linter/test_pylsp.vader | |
parent | 1e398202b9a63fcd91808a3205d3422b79435fa0 (diff) | |
download | ale-bc957015752bce79389e0092998a7b920d277670.zip |
Fix #4388: Fix pylsp and Pyright cwd
Add functions to compute the cwd to be the same as the project root for
pylsp and Pyright to work around issues in each language server when
they encounter modules that share the same name as first or third party
libraries.
Diffstat (limited to 'test/linter/test_pylsp.vader')
-rw-r--r-- | test/linter/test_pylsp.vader | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/linter/test_pylsp.vader b/test/linter/test_pylsp.vader index 290fdbf3..34cc30c6 100644 --- a/test/linter/test_pylsp.vader +++ b/test/linter/test_pylsp.vader @@ -10,6 +10,8 @@ After: call ale#assert#TearDownLinterTest() Execute(The pylsp command callback should return default string): + call ale#test#SetFilename('./foo.py') + AssertLinter 'pylsp', ale#Escape('pylsp') Execute(The pylsp executable should be configurable): @@ -22,6 +24,12 @@ Execute(The pylsp command callback should let you set options): AssertLinter 'pylsp', ale#Escape('pylsp') . ' --some-option' +Execute(The cwd and project root should be detected correctly): + call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py') + + AssertLinterCwd ale#test#GetFilename('../test-files/python/with_virtualenv/subdir') + AssertLSPProject ale#test#GetFilename('../test-files/python/with_virtualenv/subdir') + Execute(The pylsp executable should be run from the virtualenv path): call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py') |