]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/linter/test_pyre.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '56df844d3c39ec494dacc69eae34272b27db185a' as '.vim/bundle/asyncomplete'
[etc/vim.git] / .vim / bundle / ale / test / linter / test_pyre.vader
1 Before:
2   call ale#assert#SetUpLinterTest('python', 'pyre')
3   let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
4
5 After:
6   unlet! b:bin_dir
7   unlet! b:executable
8   call ale#assert#TearDownLinterTest()
9
10 Execute(The pyre command callback should return default string):
11   call ale#test#SetFilename('./foo.py')
12
13   AssertLinter 'pyre',  ale#Escape('pyre') . ' persistent'
14
15 Execute(The pyre executable should be configurable):
16   let g:ale_python_pyre_executable = '~/.local/bin/pyre'
17
18   AssertLinter '~/.local/bin/pyre',
19   \ ale#Escape('~/.local/bin/pyre') . ' persistent'
20
21 Execute(The pyre executable should be run from the virtualenv path):
22   call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
23
24   let b:executable = ale#path#Simplify(
25   \ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/pyre'
26   \)
27
28   AssertLinter b:executable, ale#Escape(b:executable) . ' persistent'
29
30 Execute(You should be able to override the pyre virtualenv lookup):
31   call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
32
33   let g:ale_python_pyre_use_global = 1
34
35   AssertLinter 'pyre', ale#Escape('pyre') . ' persistent'
36
37 Execute(Setting executable to 'pipenv' appends 'run pyre'):
38   let g:ale_python_pyre_executable = 'path/to/pipenv'
39   call ale#test#SetFilename('../test-files/dummy')
40
41   AssertLinter 'path/to/pipenv',
42   \ ale#Escape('path/to/pipenv') . ' run pyre persistent'
43
44 Execute(Pipenv is detected when python_pyre_auto_pipenv is set):
45   let g:ale_python_pyre_auto_pipenv = 1
46   call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
47
48   AssertLinter 'pipenv',
49   \ ale#Escape('pipenv') . ' run pyre persistent'
50
51 Execute(Setting executable to 'poetry' appends 'run pyre'):
52   let g:ale_python_pyre_executable = 'path/to/poetry'
53
54   AssertLinter 'path/to/poetry',
55   \ ale#Escape('path/to/poetry') . ' run pyre persistent'
56
57 Execute(Poetry is detected when python_pyre_auto_poetry is set):
58   let g:ale_python_pyre_auto_poetry = 1
59   call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
60
61   AssertLinter 'poetry',
62   \ ale#Escape('poetry') . ' run pyre persistent'
63
64 Execute(uv is detected when python_pyre_auto_uv is set):
65   let g:ale_python_pyre_auto_uv = 1
66   call ale#test#SetFilename('../test-files/python/uv/whatever.py')
67
68   AssertLinter 'uv',
69   \ ale#Escape('uv') . ' run pyre persistent'
70
71 Execute(The FindProjectRoot should detect the project root directory for namespace package via .pyre_configuration.local):
72   silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/pyre_configuration_dir/foo/bar.py')
73
74   AssertEqual
75   \ ale#path#Simplify(g:dir . '/../test-files/python/pyre_configuration_dir'),
76   \ ale#python#FindProjectRoot(bufnr(''))