Skip to content

Commit b8e93b9

Browse files
nicoddemuspre-commit-ci[bot]jakkdl
authored
[pre-commit.ci] pre-commit autoupdate (#13733)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.12 → v0.13.0](astral-sh/ruff-pre-commit@v0.12.12...v0.13.0) - [github.com/woodruffw/zizmor-pre-commit: v1.12.1 → v1.13.0](zizmorcore/zizmor-pre-commit@v1.12.1...v1.13.0) - [github.com/pre-commit/mirrors-mypy: v1.17.1 → v1.18.1](pre-commit/mirrors-mypy@v1.17.1...v1.18.1) * Comply with new lint rule for unused variables * Fix type failures in raises.py and add tests Fix typing failures after mypy 1.18 update. * test workflow: use an explicit matrix variable instead of an inline value zizmor complains that the previous approach was considered "obfuscation". Using a matrix value instead as suggested in #13733 (comment). --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bruno Oliveira <[email protected]> Co-authored-by: jakkdl <[email protected]> Co-authored-by: Bruno Oliveira <[email protected]>
2 parents 4abfdc5 + b290db3 commit b8e93b9

39 files changed

+136
-134
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ jobs:
112112
python: "3.10"
113113
os: windows-latest
114114
tox_env: "py310-pluggymain-pylib-xdist"
115+
xfail: true
115116

116117
- name: "windows-py310-xdist"
117118
python: "3.10"
@@ -132,6 +133,7 @@ jobs:
132133
python: "3.13"
133134
os: windows-latest
134135
tox_env: "py313"
136+
xfail: true
135137

136138
- name: "windows-py314"
137139
python: "3.14"
@@ -167,11 +169,13 @@ jobs:
167169
python: "3.10"
168170
os: ubuntu-latest
169171
tox_env: "py310-pluggymain-pylib-xdist"
172+
xfail: true
170173

171174
- name: "ubuntu-py310-freeze"
172175
python: "3.10"
173176
os: ubuntu-latest
174177
tox_env: "py310-freeze"
178+
xfail: true
175179

176180
- name: "ubuntu-py310-xdist"
177181
python: "3.10"
@@ -195,6 +199,7 @@ jobs:
195199
os: ubuntu-latest
196200
tox_env: "py313-pexpect"
197201
use_coverage: true
202+
xfail: true
198203

199204
- name: "ubuntu-py314"
200205
python: "3.14"
@@ -212,6 +217,7 @@ jobs:
212217
python: "3.10"
213218
os: macos-latest
214219
tox_env: "py310-xdist"
220+
xfail: true
215221

216222
- name: "macos-py312"
217223
python: "3.12"
@@ -222,6 +228,7 @@ jobs:
222228
python: "3.13"
223229
os: macos-latest
224230
tox_env: "py313-xdist"
231+
xfail: true
225232

226233
- name: "macos-py314"
227234
python: "3.14"
@@ -240,25 +247,7 @@ jobs:
240247
tox_env: "doctesting"
241248
use_coverage: true
242249

243-
continue-on-error: >-
244-
${{
245-
contains(
246-
fromJSON(
247-
'[
248-
"windows-py310-pluggy",
249-
"windows-py313",
250-
"ubuntu-py310-pluggy",
251-
"ubuntu-py310-freeze",
252-
"ubuntu-py313",
253-
"macos-py310",
254-
"macos-py313"
255-
]'
256-
),
257-
matrix.name
258-
)
259-
&& true
260-
|| false
261-
}}
250+
continue-on-error: ${{ matrix.xfail && true || false }}
262251

263252
steps:
264253
- uses: actions/checkout@v5

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
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.12.12"
3+
rev: "v0.13.0"
44
hooks:
55
- id: ruff
66
args: ["--fix"]
@@ -12,7 +12,7 @@ repos:
1212
- id: end-of-file-fixer
1313
- id: check-yaml
1414
- repo: https://github.com/woodruffw/zizmor-pre-commit
15-
rev: v1.12.1
15+
rev: v1.13.0
1616
hooks:
1717
- id: zizmor
1818
- repo: https://github.com/adamchainz/blacken-docs
@@ -32,7 +32,7 @@ repos:
3232
hooks:
3333
- id: python-use-type-annotations
3434
- repo: https://github.com/pre-commit/mirrors-mypy
35-
rev: v1.17.1
35+
rev: v1.18.1
3636
hooks:
3737
- id: mypy
3838
files: ^(src/|testing/|scripts/)

doc/en/example/.ruff.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignore = ["RUF059"]

src/_pytest/_code/source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def getstatementrange(self, lineno: int) -> tuple[int, int]:
103103
which containing the given lineno."""
104104
if not (0 <= lineno < len(self)):
105105
raise IndexError("lineno out of range")
106-
ast, start, end = getstatementrange_ast(lineno, self)
106+
_ast, start, end = getstatementrange_ast(lineno, self)
107107
return start, end
108108

109109
def deindent(self) -> Source:

src/_pytest/_py/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def new(self, **kw):
652652
if not kw:
653653
obj.strpath = self.strpath
654654
return obj
655-
drive, dirname, basename, purebasename, ext = self._getbyspec(
655+
drive, dirname, _basename, purebasename, ext = self._getbyspec(
656656
"drive,dirname,basename,purebasename,ext"
657657
)
658658
if "basename" in kw:

src/_pytest/config/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ def pytest_load_initial_conftests(self, early_config: Config) -> None:
12171217
# early_config.args it not set yet. But we need it for
12181218
# discovering the initial conftests. So "pre-run" the logic here.
12191219
# It will be done for real in `parse()`.
1220-
args, args_source = early_config._decide_args(
1220+
args, _args_source = early_config._decide_args(
12211221
args=early_config.known_args_namespace.file_or_dir,
12221222
pyargs=early_config.known_args_namespace.pyargs,
12231223
testpaths=early_config.getini("testpaths"),
@@ -1273,7 +1273,7 @@ def _consider_importhook(self, args: Sequence[str]) -> None:
12731273
and find all the installed plugins to mark them for rewriting
12741274
by the importhook.
12751275
"""
1276-
ns, unknown_args = self._parser.parse_known_and_unknown_args(args)
1276+
ns, _unknown_args = self._parser.parse_known_and_unknown_args(args)
12771277
mode = getattr(ns, "assertmode", "plain")
12781278

12791279
disable_autoload = getattr(ns, "disable_plugin_autoload", False) or bool(
@@ -1630,7 +1630,7 @@ def _getini_unknown_type(self, name: str, type: str, value: object):
16301630

16311631
def _getini(self, name: str):
16321632
try:
1633-
description, type, default = self._parser._inidict[name]
1633+
_description, type, default = self._parser._inidict[name]
16341634
except KeyError as e:
16351635
raise ValueError(f"unknown configuration value: {name!r}") from e
16361636
override_value = self._get_override_ini_value(name)

src/_pytest/helpconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def showhelp(config: Config) -> None:
185185
indent_len = 24 # based on argparse's max_help_position=24
186186
indent = " " * indent_len
187187
for name in config._parser._ininames:
188-
help, type, default = config._parser._inidict[name]
188+
help, type, _default = config._parser._inidict[name]
189189
if type is None:
190190
type = "string"
191191
if help is None:

src/_pytest/mark/structures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def get_empty_parameterset_mark(
6060

6161
argslisting = ", ".join(argnames)
6262

63-
fs, lineno = getfslineno(func)
63+
_fs, lineno = getfslineno(func)
6464
reason = f"got empty parameter set for ({argslisting})"
6565
requested_mark = config.getini(EMPTY_PARAMETERSET_OPTION)
6666
if requested_mark in ("", None, "skip"):

src/_pytest/raises.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def _parse_exc(
452452
issubclass(origin_exc, BaseExceptionGroup)
453453
and exc_type in (BaseException, Any)
454454
):
455-
if not isinstance(exc, Exception):
455+
if not issubclass(origin_exc, ExceptionGroup):
456456
self.is_baseexception = True
457457
return cast(type[BaseExcT_1], origin_exc)
458458
else:
@@ -465,9 +465,9 @@ def _parse_exc(
465465
)
466466
# unclear if the Type/ValueError distinction is even helpful here
467467
msg = f"expected exception must be {expected}, not "
468-
if isinstance(exc, type):
468+
if isinstance(exc, type): # type: ignore[unreachable]
469469
raise ValueError(msg + f"{exc.__name__!r}")
470-
if isinstance(exc, BaseException):
470+
if isinstance(exc, BaseException): # type: ignore[unreachable]
471471
raise TypeError(msg + f"an exception instance ({type(exc).__name__})")
472472
raise TypeError(msg + repr(type(exc).__name__))
473473

src/_pytest/reports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def head_line(self) -> str | None:
188188
even in patch releases.
189189
"""
190190
if self.location is not None:
191-
fspath, lineno, domain = self.location
191+
_fspath, _lineno, domain = self.location
192192
return domain
193193
return None
194194

0 commit comments

Comments
 (0)