Skip to content

Add tests for syntax error messages that had no test coverage#153192

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:syntax-error-message-tests
Jul 6, 2026
Merged

Add tests for syntax error messages that had no test coverage#153192
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:syntax-error-message-tests

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Add tests for three specialized syntax error messages which a coverage audit of the error rules in Grammar/python.gram found untested:

  • illegal target for annotation (e.g. 1: int) had no tests at all;
  • cannot use dict unpacking here (e.g. (**a)) had no tests at all;
  • f-string: expecting '!', or ':', or '}' (e.g. f'{a=b}') was only tested for its t-string variant.

🤖 Generated with Claude Code

"illegal target for annotation" and "cannot use dict unpacking here"
were not tested at all, and "f-string: expecting '!', or ':', or '}'"
was only tested for its t-string variant.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka merged commit 836b206 into python:main Jul 6, 2026
60 checks passed
@serhiy-storchaka serhiy-storchaka deleted the syntax-error-message-tests branch July 6, 2026 13:49
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 6, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 6, 2026

Copy link
Copy Markdown

GH-153196 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 6, 2026
serhiy-storchaka added a commit that referenced this pull request Jul 6, 2026
…H-153192) (GH-153196)

Add tests for syntax error messages that had no test coverage (GH-153192)

"illegal target for annotation" and "cannot use dict unpacking here"
were not tested at all, and "f-string: expecting '!', or ':', or '}'"
was only tested for its t-string variant.
(cherry picked from commit 836b206)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip issue skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants