diff options
Diffstat (limited to 'test/handler')
-rw-r--r-- | test/handler/test_mypy_handler.vader | 30 |
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', + \ ]) |