[ruff] Apply safe autofixes from ruff 0.16 - #14897
Conversation
09c9579 to
1d06f11
Compare
| teardown = getattr(cls, "tearDownClass", None) | ||
| if setup is None and teardown is None: | ||
| return None | ||
| return |
There was a problem hiding this comment.
This line isn't covered by tests because unittest.TestCase defines both setUpClass and tearDownClass as classmethods so it cannot be reached afaiu.
There was a problem hiding this comment.
Should we log a followup issue about removing this based on supported versions?
There was a problem hiding this comment.
I looked it up, unittest.TestCase has carried default no-op setUpClass/tearDownClass classmethods since Python 3.2 (https://docs.python.org/3/library/unittest.html#unittest.TestCase.setUpClass / python/cpython@847a4110ea99). PyPy takes unittest verbatim from CPython's pure-Python stdlib. This line was introduced in pytest in a616adf probably taken from 0f918b1 that was more generic (handle pytest struct too ?)
1d06f11 to
f9624d1
Compare
|
It seems I can't merge if codecov is not 100%. I only have the enable auto-merge button and no way to bypass. (Change in github's UI? Also happens in pylint and I didn't touch anything) I'll do the follow-up PR as a prior PR then. |
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>
f9624d1 to
f0b1c4e
Compare
Continuing after #14895, this enable the rule that have safe autofixes.