Skip to content

ENH: allow suspicious-looking reasons in skip when passed as keyword without warning - #15367

Open
neutrinoceros wants to merge 1 commit into
pytest-dev:mainfrom
neutrinoceros:enh/no-warning-skip-w-kwarg-reason
Open

neutrinoceros wants to merge 1 commit into
pytest-dev:mainfrom
neutrinoceros:enh/no-warning-skip-w-kwarg-reason

Conversation

@neutrinoceros

Copy link
Copy Markdown
Contributor

close #15366

@neutrinoceros
neutrinoceros force-pushed the enh/no-warning-skip-w-kwarg-reason branch from 0942f2a to 35a6af5 Compare November 10, 2026 08:05
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

I guess it probably doesn't make sense to add a changelog entry for this as a change to an unreleased feature, but maybe I should update the one from gh-15252 ?

@RonnyPfannschmidt RonnyPfannschmidt added the skip news used on prs to opt out of the changelog requirement label Nov 10, 2026

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks

Comment thread testing/test_skipping.py
f"""
import pytest

@pytest.mark.skip({reason=!r})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

at first glance that format string looks wrong, the equals form is something one has to get used to 🦺

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Would you prefer the following, equivalent form ?

Suggested change
@pytest.mark.skip({reason=!r})
@pytest.mark.skip(reason={reason!r})

(for reference, the syntax I used was introduced in Python 3.8)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's fine as is im just bemused that the "new" syntax looks "wrong " to me

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news used on prs to opt out of the changelog requirement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: false positives from gh-15252

2 participants