@@ -161,6 +161,7 @@ lint.ignore = [
161161 " PLW2901" , # for loop variable overwritten by assignment target
162162 # ruff ignore
163163 " RUF012" , # Mutable class attributes should be annotated with `typing.ClassVar`
164+ " RUF061" , # Use context-manager form of `pytest.raises()`
164165]
165166lint.per-file-ignores."src/_pytest/_py/**/*.py" = [
166167 " B" ,
@@ -169,6 +170,8 @@ lint.per-file-ignores."src/_pytest/_py/**/*.py" = [
169170lint.per-file-ignores."src/_pytest/_version.py" = [
170171 " I001" ,
171172]
173+ # 'Unnecessary membership test on empty collection', always voluntary in tests
174+ lint.per-file-ignores."testing/**/*.py" = [ " RUF060" ]
172175# can't be disabled on a line-by-line basis in file
173176lint.per-file-ignores."testing/code/test_source.py" = [
174177 " F841" ,
@@ -217,31 +220,30 @@ disable = [
217220 " comparison-with-callable" ,
218221 " comparison-with-itself" , # PLR0124 from ruff
219222 " condition-evals-to-constant" ,
220- " consider-alternative-union-syntax" ,
221223 " confusing-consecutive-elif" ,
224+ " consider-alternative-union-syntax" ,
225+ " consider-ternary-expression" ,
222226 " consider-using-assignment-expr" ,
223227 " consider-using-dict-items" ,
224- " consider-using-from-import" ,
228+ " consider-using-from-import" , # not activated by default, PLR0402 disabled in ruff
225229 " consider-using-f-string" ,
226230 " consider-using-in" ,
227231 " consider-using-namedtuple-or-dataclass" ,
228232 " consider-using-ternary" ,
229233 " consider-using-tuple" ,
230234 " consider-using-with" ,
231- " consider-using-from-import" , # not activated by default, PLR0402 disabled in ruff
232- " consider-ternary-expression" ,
233235 " cyclic-import" ,
234- " differing-param-doc" ,
235- " docstring-first-line-empty" ,
236236 " deprecated-argument" ,
237237 " deprecated-attribute" ,
238238 " deprecated-class" ,
239+ " differing-param-doc" ,
239240 " disallowed-name" , # foo / bar are used often in tests
241+ " docstring-first-line-empty" ,
240242 " duplicate-code" ,
241243 " else-if-used" , # not activated by default, PLR5501 disabled in ruff
242244 " empty-comment" , # not activated by default, PLR2044 disabled in ruff
243- " eval-used" ,
244245 " eq-without-hash" , # PLW1641 disabled in ruff
246+ " eval-used" ,
245247 " exec-used" ,
246248 " expression-not-assigned" ,
247249 " fixme" ,
@@ -258,13 +260,13 @@ disable = [
258260 " line-too-long" ,
259261 " magic-value-comparison" , # not activated by default, PLR2004 disabled in ruff
260262 " method-hidden" ,
263+ " misplaced-bare-raise" , # PLE0704 from ruff
264+ " misplaced-comparison-constant" ,
261265 " missing-docstring" ,
262266 " missing-param-doc" ,
263267 " missing-raises-doc" ,
264268 " missing-timeout" ,
265269 " missing-type-doc" ,
266- " misplaced-bare-raise" , # PLE0704 from ruff
267- " misplaced-comparison-constant" ,
268270 " multiple-statements" , # multiple-statements-on-one-line-colon (E701) from ruff
269271 " no-else-break" ,
270272 " no-else-continue" ,
@@ -329,10 +331,10 @@ disable = [
329331 " use-dict-literal" ,
330332 " use-implicit-booleaness-not-comparison" ,
331333 " use-implicit-booleaness-not-len" ,
332- " use-set-for-membership" ,
333334 " useless-else-on-loop" , # PLC0414 disabled in ruff
334335 " useless-import-alias" ,
335336 " useless-return" ,
337+ " use-set-for-membership" ,
336338 " using-constant-test" ,
337339 " while-used" ,
338340 " wrong-import-order" , # handled by isort / ruff
0 commit comments