summaryrefslogtreecommitdiff
path: root/test/linter
diff options
context:
space:
mode:
Diffstat (limited to 'test/linter')
-rw-r--r--test/linter/test_pylsp.vader8
-rw-r--r--test/linter/test_pyre.vader2
-rw-r--r--test/linter/test_pyright.vader8
3 files changed, 18 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')
diff --git a/test/linter/test_pyre.vader b/test/linter/test_pyre.vader
index 331d97ed..053ef12f 100644
--- a/test/linter/test_pyre.vader
+++ b/test/linter/test_pyre.vader
@@ -8,6 +8,8 @@ After:
call ale#assert#TearDownLinterTest()
Execute(The pyre command callback should return default string):
+ call ale#test#SetFilename('./foo.py')
+
AssertLinter 'pyre', ale#Escape('pyre') . ' persistent'
Execute(The pyre executable should be configurable):
diff --git a/test/linter/test_pyright.vader b/test/linter/test_pyright.vader
index 95dfd853..14e8c142 100644
--- a/test/linter/test_pyright.vader
+++ b/test/linter/test_pyright.vader
@@ -10,6 +10,8 @@ After:
call ale#assert#TearDownLinterTest()
Execute(The command callback should return the correct default string):
+ call ale#test#SetFilename('./foo.py')
+
AssertLinter
\ 'pyright-langserver',
\ ale#Escape('pyright-langserver') . ' --stdio'
@@ -30,6 +32,12 @@ Execute(The default configuration should be mostly empty):
AssertLSPConfig {'python': {}}
+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(virtualenv paths should be set in configuration by default):
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')