aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2025-02-13 01:30:20 +0000
committerGitHub <noreply@github.com>2025-02-13 01:30:20 +0000
commit6fb5138776fe84e3769b8aff66c1726c788d84ed (patch)
tree36723c3cb6ad880c2004d612814bbf55acd93e5b /Lib/test/test_syntax.py
parent56eda256336310a08d4beb75b998488cb359444b (diff)
downloadcpython-6fb5138776fe84e3769b8aff66c1726c788d84ed.tar.gz
cpython-6fb5138776fe84e3769b8aff66c1726c788d84ed.zip
gh-88535: Improve syntax error for wrongly closed strings (#26633)
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 132e2b83962..6d06e6f6dcb 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -312,6 +312,12 @@ SyntaxError: did you forget parentheses around the comprehension target?
Traceback (most recent call last):
SyntaxError: did you forget parentheses around the comprehension target?
+# Incorrectly closed strings
+
+>>> "The interesting object "The important object" is very important"
+Traceback (most recent call last):
+SyntaxError: invalid syntax. Is this intended to be part of the string?
+
# Missing commas in literals collections should not
# produce special error messages regarding missing
# parentheses, but about missing commas instead