summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-01-11 16:43:10 +0000
committerw0rp <devw0rp@gmail.com>2018-01-11 16:43:10 +0000
commitadba2bd919d5463e16c586a90698588cca9725b6 (patch)
treec033331680cbb79ae94af677642ac76a0b0a5b1b /test/handler
parentf1747901cc00abb7becb64c02bfccad46b66ed21 (diff)
downloadale-adba2bd919d5463e16c586a90698588cca9725b6.zip
Allow syntax errors for mypy to be ignored
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_mypy_handler.vader30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/handler/test_mypy_handler.vader b/test/handler/test_mypy_handler.vader
index abb8504a..f3d4cbf8 100644
--- a/test/handler/test_mypy_handler.vader
+++ b/test/handler/test_mypy_handler.vader
@@ -1,9 +1,15 @@
Before:
+ Save g:ale_python_mypy_ignore_invalid_syntax
+
+ unlet! g:ale_python_mypy_ignore_invalid_syntax
+
runtime ale_linters/python/mypy.vim
call ale#test#SetDirectory('/testplugin/test/handler')
After:
+ Restore
+
call ale#test#RestoreDirectory()
call ale#linter#Reset()
@@ -80,3 +86,27 @@ Execute(The mypy handler should handle Windows names with spaces):
\ ale_linters#python#mypy#Handle(bufnr(''), [
\ 'C:\something\with spaces.py:4: error: No library stub file for module ''django.db''',
\ ])
+
+Execute(The mypy syntax errors shouldn't be ignored by default):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 4,
+ \ 'col': 0,
+ \ 'filename': ale#path#Simplify(g:dir . '/foo.py'),
+ \ 'type': 'E',
+ \ 'text': 'invalid syntax',
+ \ },
+ \ ],
+ \ ale_linters#python#mypy#Handle(bufnr(''), [
+ \ 'foo.py:4: error: invalid syntax',
+ \ ])
+
+Execute(The mypy syntax errors should be ignored when the option is on):
+ let g:ale_python_mypy_ignore_invalid_syntax = 1
+
+ AssertEqual
+ \ [],
+ \ ale_linters#python#mypy#Handle(bufnr(''), [
+ \ 'foo.py:4: error: invalid syntax',
+ \ ])