diff options
| author | AlexSm <[email protected]> | 2024-04-23 14:59:54 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-23 14:59:54 +0200 |
| commit | 5382ebc0c2cf36a28b1b2f7d7c1a70bf016bfca8 (patch) | |
| tree | e723fd21521cf16e7e8c683ffd4d17d182d52531 /contrib/python/parso/py3/tests/test_python_errors.py | |
| parent | 5376b614ef34883a21b7d1e448c3282573ad3f91 (diff) | |
| parent | 38e73e80b89e9bc2ad96768cf3b7dd44d9718fc7 (diff) | |
Merge pull request #4024 from ydb-platform/mergelibs-240423-0906
Library import 240423-0906
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 |
