Skip to content

Commit 570d8ac

Browse files
authored
Merge branch 'pytest-dev:main' into main
2 parents f6576ae + 4e3dd21 commit 570d8ac

File tree

13 files changed

+626
-293
lines changed

13 files changed

+626
-293
lines changed

.github/workflows/stale.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
days-before-issue-close: 7
1818
only-labels: "status: needs information"
1919
stale-issue-label: "stale"
20-
stale-issue-message: "This issue is stale because it has been open for 14 days with no activity."
21-
close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale."
20+
stale-issue-message: "This issue is stale because it has the `status: needs information` label and requested follow-up information was not provided for 14 days."
21+
close-issue-message: "This issue was closed because it has the `status: needs information` label and follow-up information has not been provided for 7 days since being marked as stale."
2222
days-before-pr-stale: -1
2323
days-before-pr-close: -1

.pre-commit-config.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: "v0.3.3"
3+
rev: "v0.3.5"
44
hooks:
55
- id: ruff
66
args: ["--fix"]
@@ -50,6 +50,13 @@ repos:
5050
additional_dependencies: ["tox>=4.9"]
5151
- repo: local
5252
hooks:
53+
- id: pylint
54+
name: pylint
55+
entry: pylint
56+
language: system
57+
types: [python]
58+
args: ["-rn", "-sn", "--fail-on=I"]
59+
stages: [manual]
5360
- id: rst
5461
name: rst
5562
entry: rst-lint --encoding utf-8

changelog/12135.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix fixtures adding their finalizer multiple times to fixtures they request, causing unreliable and non-intuitive teardown ordering in some instances.

doc/en/how-to/doctest.rst

+1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ place the objects you want to appear in the doctest namespace:
224224
.. code-block:: python
225225
226226
# content of conftest.py
227+
import pytest
227228
import numpy
228229
229230

doc/en/reference/plugin_list.rst

+257-113
Large diffs are not rendered by default.

doc/en/reference/reference.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pytest.freeze_includes
136136
Marks
137137
-----
138138

139-
Marks can be used apply meta data to *test functions* (but not fixtures), which can then be accessed by
139+
Marks can be used to apply metadata to *test functions* (but not fixtures), which can then be accessed by
140140
fixtures or plugins.
141141

142142

pyproject.toml

+113
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,119 @@ lines-after-imports = 2
165165
"src/_pytest/_version.py" = ["I001"]
166166
"testing/python/approx.py" = ["B015"]
167167

168+
[tool.pylint.main]
169+
# Maximum number of characters on a single line.
170+
max-line-length = 120
171+
disable= [
172+
"abstract-method",
173+
"arguments-differ",
174+
"arguments-renamed",
175+
"assigning-non-slot",
176+
"attribute-defined-outside-init",
177+
"bad-classmethod-argument",
178+
"bad-mcs-method-argument",
179+
"broad-exception-caught",
180+
"broad-exception-raised",
181+
"cell-var-from-loop",
182+
"comparison-of-constants",
183+
"comparison-with-callable",
184+
"comparison-with-itself",
185+
"condition-evals-to-constant",
186+
"consider-using-dict-items",
187+
"consider-using-enumerate",
188+
"consider-using-from-import",
189+
"consider-using-f-string",
190+
"consider-using-in",
191+
"consider-using-sys-exit",
192+
"consider-using-ternary",
193+
"consider-using-with",
194+
"cyclic-import",
195+
"disallowed-name",
196+
"duplicate-code",
197+
"eval-used",
198+
"exec-used",
199+
"expression-not-assigned",
200+
"fixme",
201+
"global-statement",
202+
"implicit-str-concat",
203+
"import-error",
204+
"import-outside-toplevel",
205+
"inconsistent-return-statements",
206+
"invalid-bool-returned",
207+
"invalid-name",
208+
"invalid-repr-returned",
209+
"invalid-str-returned",
210+
"keyword-arg-before-vararg",
211+
"line-too-long",
212+
"method-hidden",
213+
"misplaced-bare-raise",
214+
"missing-docstring",
215+
"missing-timeout",
216+
"multiple-statements",
217+
"no-else-break",
218+
"no-else-continue",
219+
"no-else-raise",
220+
"no-else-return",
221+
"no-member",
222+
"no-name-in-module",
223+
"no-self-argument",
224+
"not-an-iterable",
225+
"not-callable",
226+
"pointless-exception-statement",
227+
"pointless-statement",
228+
"pointless-string-statement",
229+
"protected-access",
230+
"raise-missing-from",
231+
"redefined-argument-from-local",
232+
"redefined-builtin",
233+
"redefined-outer-name",
234+
"reimported",
235+
"simplifiable-condition",
236+
"simplifiable-if-expression",
237+
"singleton-comparison",
238+
"superfluous-parens",
239+
"super-init-not-called",
240+
"too-few-public-methods",
241+
"too-many-ancestors",
242+
"too-many-arguments",
243+
"too-many-branches",
244+
"too-many-function-args",
245+
"too-many-instance-attributes",
246+
"too-many-lines",
247+
"too-many-locals",
248+
"too-many-nested-blocks",
249+
"too-many-public-methods",
250+
"too-many-return-statements",
251+
"too-many-statements",
252+
"try-except-raise",
253+
"typevar-name-incorrect-variance",
254+
"unbalanced-tuple-unpacking",
255+
"undefined-loop-variable",
256+
"undefined-variable",
257+
"unexpected-keyword-arg",
258+
"unidiomatic-typecheck",
259+
"unnecessary-comprehension",
260+
"unnecessary-dunder-call",
261+
"unnecessary-lambda",
262+
"unnecessary-lambda-assignment",
263+
"unpacking-non-sequence",
264+
"unspecified-encoding",
265+
"unsubscriptable-object",
266+
"unused-argument",
267+
"unused-import",
268+
"unused-variable",
269+
"used-before-assignment",
270+
"use-dict-literal",
271+
"use-implicit-booleaness-not-comparison",
272+
"use-implicit-booleaness-not-len",
273+
"useless-else-on-loop",
274+
"useless-import-alias",
275+
"useless-return",
276+
"use-maxsplit-arg",
277+
"using-constant-test",
278+
"wrong-import-order",
279+
]
280+
168281
[tool.check-wheel-contents]
169282
# check-wheel-contents is executed by the build-and-inspect-python-package action.
170283
# W009: Wheel contains multiple toplevel library entries

0 commit comments

Comments
 (0)