aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/parso/py3/tests/test_python_errors.py
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2024-04-23 09:07:41 +0000
committerAlexander Smirnov <alex@ydb.tech>2024-04-23 09:07:41 +0000
commitb35b2344f47ddaef21fb74c7f5cad9cd91d3cb45 (patch)
treee7b382f5c6cce63ce1e160d51ad1aac846ba2905 /contrib/python/parso/py3/tests/test_python_errors.py
parentb3bee3aa6d7c8767695b8917484e6bb488e9c8ca (diff)
parentae5472d0928c374dc719b154c9dcb2be6e0a0695 (diff)
downloadydb-b35b2344f47ddaef21fb74c7f5cad9cd91d3cb45.tar.gz
Merge branch 'rightlib' into mergelibs-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.py23
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