Skip to content

Comments

main: reject arguments like pytest x.py[1] instead of ignoring the []#13717

Merged
bluetech merged 1 commit intopytest-dev:mainfrom
bluetech:squaket
Sep 11, 2025
Merged

main: reject arguments like pytest x.py[1] instead of ignoring the []#13717
bluetech merged 1 commit intopytest-dev:mainfrom
bluetech:squaket

Conversation

@bluetech
Copy link
Member

Fix #13716.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Sep 10, 2025
If the path doesn't exist, raise UsageError.
If the path is a directory and selection parts are present, raise UsageError.
"""
base, squacket, rest = str(arg).partition("[")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is unrelated, but arg is already an str, I snuck it in.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@bluetech bluetech merged commit d2d57e3 into pytest-dev:main Sep 11, 2025
36 checks passed
@bluetech bluetech deleted the squaket branch September 11, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pytest x.py[param] is silently treated as pytest x.py

2 participants