Skip to content

[ruff] Apply safe autofixes from ruff 0.16 - #14897

Open
Pierre-Sassoulas wants to merge 5 commits into
pytest-dev:mainfrom
Pierre-Sassoulas:ruff-safe-autofixes
Open

[ruff] Apply safe autofixes from ruff 0.16#14897
Pierre-Sassoulas wants to merge 5 commits into
pytest-dev:mainfrom
Pierre-Sassoulas:ruff-safe-autofixes

Conversation

@Pierre-Sassoulas

Copy link
Copy Markdown
Member

Continuing after #14895, this enable the rule that have safe autofixes.

@Pierre-Sassoulas Pierre-Sassoulas added the skip news used on prs to opt out of the changelog requirement label Aug 17, 2026
Pierre-Sassoulas and others added 5 commits August 17, 2026 20:15
Both functions return nothing anywhere else, so a bare 'return' says it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two modules kept an 'if TYPE_CHECKING: pass' block and the import that
went with it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
'Decimal("1")' and 'Decimal(1)' build the same value, the int form skips
the string parsing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Eight hand-rolled 'startswith' + slice pairs become the dedicated string
methods.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Nine '"a b c".split()' calls become plain list literals.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread src/_pytest/unittest.py
teardown = getattr(cls, "tearDownClass", None)
if setup is None and teardown is None:
return None
return

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This line isn't covered by tests because unittest.TestCase defines both setUpClass and tearDownClass as classmethods so it cannot be reached afaiu.

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.

1 participant