]> git.madduck.net Git - etc/vim.git/blob - test/linter/test_pyflakes.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:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / test / linter / test_pyflakes.vader
1 Before:
2   call ale#assert#SetUpLinterTest('python', 'pyflakes')
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 pyflakes command callback should return default string):
11   AssertLinter 'pyflakes', ale#Escape('pyflakes') . ' %t'
12
13 Execute(The pyflakes executable should be configurable):
14   let g:ale_python_pyflakes_executable = '~/.local/bin/pyflakes'
15
16   AssertLinter '~/.local/bin/pyflakes',
17   \ ale#Escape('~/.local/bin/pyflakes') . ' %t'
18
19 Execute(The pyflakes executable should be run from the virtualenv path):
20   call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
21
22   let b:executable = ale#path#Simplify(
23   \ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/pyflakes'
24   \)
25
26   AssertLinter b:executable, ale#Escape(b:executable) . ' %t'
27
28 Execute(You should be able to override the pyflakes virtualenv lookup):
29   call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
30
31   let g:ale_python_pyflakes_use_global = 1
32
33   AssertLinter 'pyflakes', ale#Escape('pyflakes') . ' %t'
34
35 Execute(Setting executable to 'pipenv' appends 'run pyflakes'):
36   let g:ale_python_pyflakes_executable = 'path/to/pipenv'
37   call ale#test#SetFilename('../test-files/dummy')
38
39   AssertLinter 'path/to/pipenv',
40   \ ale#Escape('path/to/pipenv') . ' run pyflakes %t',
41
42 Execute(Pipenv is detected when python_pyflakes_auto_pipenv is set):
43   let g:ale_python_pyflakes_auto_pipenv = 1
44   call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
45
46   AssertLinter 'pipenv',
47   \ ale#Escape('pipenv') . ' run pyflakes %t'
48
49 Execute(Setting executable to 'poetry' appends 'run pyflakes'):
50   let g:ale_python_pyflakes_executable = 'path/to/poetry'
51
52   AssertLinter 'path/to/poetry',
53   \ ale#Escape('path/to/poetry') . ' run pyflakes %t',
54
55 Execute(Poetry is detected when python_pyflakes_auto_poetry is set):
56   let g:ale_python_pyflakes_auto_poetry = 1
57   call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
58
59   AssertLinter 'poetry',
60   \ ale#Escape('poetry') . ' run pyflakes %t'
61
62 Execute(uv is detected when python_pyflakes_auto_uv is set):
63   let g:ale_python_pyflakes_auto_uv = 1
64   call ale#test#SetFilename('../test-files/python/uv/whatever.py')
65
66   AssertLinter 'uv',
67   \ ale#Escape('uv') . ' run pyflakes %t'