summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2020-01-02 14:19:21 +0000
committerw0rp <devw0rp@gmail.com>2020-01-02 14:19:21 +0000
commit8c4c8dfd97b6a7d24b490f8645d7c54461c45d52 (patch)
treed442d9cec77f8e4db90d19103c399dc0d77d8043 /test
parent0cb432cb825e80c5a6f6dc9bc9c52a38f9b45319 (diff)
downloadale-8c4c8dfd97b6a7d24b490f8645d7c54461c45d52.zip
Fix #2704 - Show mypy notes; can be disabled
Diffstat (limited to 'test')
-rw-r--r--test/handler/test_mypy_handler.vader27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/handler/test_mypy_handler.vader b/test/handler/test_mypy_handler.vader
index 6e96f3f3..58d2b69e 100644
--- a/test/handler/test_mypy_handler.vader
+++ b/test/handler/test_mypy_handler.vader
@@ -1,6 +1,8 @@
Before:
Save g:ale_python_mypy_ignore_invalid_syntax
+ Save g:ale_python_mypy_show_notes
+ unlet! g:ale_python_mypy_show_notes
unlet! g:ale_python_mypy_ignore_invalid_syntax
runtime ale_linters/python/mypy.vim
@@ -69,6 +71,31 @@ Execute(The mypy handler should parse lines correctly):
\ '__init__.py:72:1: warning: Some warning',
\ ])
+Execute(The mypy handler should show notes if enabled):
+ call ale#test#SetFilename('__init__.py')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 72,
+ \ 'col': 1,
+ \ 'filename': ale#path#Simplify(g:dir . '/__init__.py'),
+ \ 'type': 'I',
+ \ 'text': 'A note',
+ \ },
+ \ ],
+ \ ale_linters#python#mypy#Handle(bufnr(''), [
+ \ '__init__.py:72:1: note: A note',
+ \ ])
+
+ let g:ale_python_mypy_show_notes = 0
+
+ AssertEqual
+ \ [],
+ \ ale_linters#python#mypy#Handle(bufnr(''), [
+ \ '__init__.py:72:1: note: A note',
+ \ ])
+
Execute(The mypy handler should handle Windows names with spaces):
" This test works on Unix, where this is seen as a single filename
silent file C:\\something\\with\ spaces.py