mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-06 21:16:54 +00:00
parent
9815f49cc4
commit
255122c2a6
2 changed files with 9 additions and 3 deletions
|
|
@ -580,8 +580,8 @@ class FileChecker:
|
|||
"""Run checks against the file."""
|
||||
assert self.processor is not None
|
||||
try:
|
||||
self.process_tokens()
|
||||
self.run_ast_checks()
|
||||
self.process_tokens()
|
||||
except exceptions.InvalidSyntax as exc:
|
||||
self.report(
|
||||
exc.error_code,
|
||||
|
|
|
|||
|
|
@ -183,7 +183,10 @@ def test_tokenization_error_but_not_syntax_error(tmpdir, capsys):
|
|||
_call_main(['t.py'], retv=1)
|
||||
|
||||
out, err = capsys.readouterr()
|
||||
assert out == 't.py:1:1: E902 TokenError: EOF in multi-line statement\n'
|
||||
assert out == '''\
|
||||
t.py:1:1: E902 TokenError: EOF in multi-line statement
|
||||
t.py:1:8: E999 SyntaxError: unexpected EOF while parsing
|
||||
'''
|
||||
assert err == ''
|
||||
|
||||
|
||||
|
|
@ -194,7 +197,10 @@ def test_tokenization_error_is_a_syntax_error(tmpdir, capsys):
|
|||
_call_main(['t.py'], retv=1)
|
||||
|
||||
out, err = capsys.readouterr()
|
||||
assert out == 't.py:1:1: E902 IndentationError: unindent does not match any outer indentation level\n' # noqa: E501
|
||||
assert out == '''\
|
||||
t.py:1:1: E902 IndentationError: unindent does not match any outer indentation level
|
||||
t.py:3:5: E999 IndentationError: unindent does not match any outer indentation level
|
||||
''' # noqa: E501
|
||||
assert err == ''
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue