install.fairie/dotfiles/.vim/plugged/ale/test/test_python_traceback.vader
Git E2E Dev Test Username e149692cc9 git subrepo clone https://github.com/dense-analysis/ale.git ./dotfiles/.vim/plugged/ale
subrepo:
  subdir:   "dotfiles/.vim/plugged/ale"
  merged:   "e4b205440"
upstream:
  origin:   "https://github.com/dense-analysis/ale.git"
  branch:   "master"
  commit:   "e4b205440"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:37:09 -04:00

79 lines
2.5 KiB
Text

Execute(ale#python#HandleTraceback returns empty List for empty lines):
AssertEqual
\ [],
\ ale#python#HandleTraceback([], 10)
Execute(ale#python#HandleTraceback returns traceback, when present):
AssertEqual
\ [{
\ 'lnum': 1,
\ 'text': 'Exception: Example error (See :ALEDetail)',
\ 'detail': join([
\ 'Traceback (most recent call last):',
\ ' File "./example.py", line 5, in <module>',
\ ' raise Exception(''Example message'')',
\ 'Exception: Example error',
\ ], "\n"),
\ }],
\ ale#python#HandleTraceback([
\ 'Traceback (most recent call last):',
\ ' File "./example.py", line 5, in <module>',
\ ' raise Exception(''Example message'')',
\ 'Exception: Example error',
\ ], 1)
" SyntaxError has extra output lines about the source
Execute(ale#python#HandleTraceback returns SyntaxError traceback):
AssertEqual
\ [{
\ 'lnum': 1,
\ 'text': 'SyntaxError: invalid syntax (See :ALEDetail)',
\ 'detail': join([
\ 'Traceback (most recent call last):',
\ ' File "<string>", line 1, in <module>',
\ ' File "example.py", line 5',
\ ' +',
\ ' ^',
\ 'SyntaxError: invalid syntax',
\ ], "\n"),
\ }],
\ ale#python#HandleTraceback([
\ 'Traceback (most recent call last):',
\ ' File "<string>", line 1, in <module>',
\ ' File "example.py", line 5',
\ ' +',
\ ' ^',
\ 'SyntaxError: invalid syntax',
\ ], 1)
Execute(ale#python#HandleTraceback ignores traceback after line limit):
AssertEqual
\ [],
\ ale#python#HandleTraceback([
\ '',
\ 'Traceback (most recent call last):',
\ ' File "./example.py", line 5, in <module>',
\ ' raise Exception(''Example message'')',
\ 'Exception: Example error',
\ ], 1)
Execute(ale#python#HandleTraceback doesn't include later lines in detail):
AssertEqual
\ [{
\ 'lnum': 1,
\ 'text': 'Exception: Example error (See :ALEDetail)',
\ 'detail': join([
\ 'Traceback (most recent call last):',
\ ' File "./example.py", line 5, in <module>',
\ ' raise Exception(''Example message'')',
\ 'Exception: Example error',
\ ], "\n"),
\ }],
\ ale#python#HandleTraceback([
\ 'Traceback (most recent call last):',
\ ' File "./example.py", line 5, in <module>',
\ ' raise Exception(''Example message'')',
\ 'Exception: Example error',
\ 'file:1:2: Style issue',
\ 'file:3:4: Non-style issue',
\ ], 1)