diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-04-20 09:18:55 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-04-20 09:39:03 +0300 |
commit | 19be936dfe8ff1852437f6a73bb7919cfb06b8be (patch) | |
tree | c98e3f559152be2d96b22c2741d19212cb0bf63f /contrib/python/parso/py3/tests/test_python_errors.py | |
parent | aed0d7a803f63c28bb7eb37540614fecd7676220 (diff) | |
download | ydb-19be936dfe8ff1852437f6a73bb7919cfb06b8be.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/python/parso/py3/tests/test_python_errors.py')
-rw-r--r-- | contrib/python/parso/py3/tests/test_python_errors.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/contrib/python/parso/py3/tests/test_python_errors.py b/contrib/python/parso/py3/tests/test_python_errors.py index fe43a301ad0..b4986d33f6b 100644 --- a/contrib/python/parso/py3/tests/test_python_errors.py +++ b/contrib/python/parso/py3/tests/test_python_errors.py @@ -1,6 +1,7 @@ """ Testing if parso finds syntax errors and indentation errors. """ +import re import sys import warnings @@ -136,6 +137,28 @@ def _get_actual_exception(code): wanted = 'SyntaxError: invalid syntax' elif wanted == "SyntaxError: f-string: single '}' is not allowed": wanted = 'SyntaxError: invalid syntax' + elif "Maybe you meant '==' instead of '='?" in wanted: + wanted = wanted.removesuffix(" here. Maybe you meant '==' instead of '='?") + elif re.match( + r"SyntaxError: unterminated string literal \(detected at line \d+\)", wanted + ): + wanted = "SyntaxError: EOL while scanning string literal" + elif re.match( + r"SyntaxError: unterminated triple-quoted string literal \(detected at line \d+\)", + wanted, + ): + wanted = 'SyntaxError: EOF while scanning triple-quoted string literal' + elif wanted == 'SyntaxError: cannot use starred expression here': + wanted = "SyntaxError: can't use starred expression here" + elif wanted == 'SyntaxError: f-string: cannot use starred expression here': + wanted = "SyntaxError: f-string: can't use starred expression here" + elif re.match( + r"IndentationError: expected an indented block after '[^']*' statement on line \d", + wanted, + ): + wanted = 'IndentationError: expected an indented block' + elif wanted == 'SyntaxError: unterminated string literal': + wanted = 'SyntaxError: EOL while scanning string literal' return [wanted], line_nr |