Skip to content

Commit 48bcb05

Browse files
pre-commit-ci[bot]webknjaz
authored andcommitted
[pre-commit.ci] pre-commit autoupdate
updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.9 → v0.7.2](astral-sh/ruff-pre-commit@v0.6.9...v0.7.2) - [github.com/adamchainz/blacken-docs: 1.19.0 → 1.19.1](adamchainz/blacken-docs@1.19.0...1.19.1) - [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.13.0](pre-commit/mirrors-mypy@v1.11.2...v1.13.0) - [github.com/tox-dev/pyproject-fmt: 2.3.1 → v2.5.0](tox-dev/pyproject-fmt@2.3.1...v2.5.0) - [github.com/asottile/pyupgrade: v3.18.0 → v3.19.0](asottile/pyupgrade@v3.18.0...v3.19.0) [mypy] Remove useless noqa, add noqa for new false positives Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
1 parent c85faf0 commit 48bcb05

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 5 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.6.9"
3+
rev: "v0.7.2"
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/adamchainz/blacken-docs
15-
rev: 1.19.0
15+
rev: 1.19.1
1616
hooks:
1717
- id: blacken-docs
1818
additional_dependencies: [black==24.1.1]
@@ -28,7 +28,7 @@ repos:
2828
hooks:
2929
- id: python-use-type-annotations
3030
- repo: https://github.com/pre-commit/mirrors-mypy
31-
rev: v1.11.2
31+
rev: v1.13.0
3232
hooks:
3333
- id: mypy
3434
files: ^(src/|testing/|scripts/)
@@ -44,13 +44,13 @@ repos:
4444
# on <3.11
4545
- exceptiongroup>=1.0.0rc8
4646
- repo: https://github.com/tox-dev/pyproject-fmt
47-
rev: "2.3.1"
47+
rev: "v2.5.0"
4848
hooks:
4949
- id: pyproject-fmt
5050
# https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version
5151
additional_dependencies: ["tox>=4.9"]
5252
- repo: https://github.com/asottile/pyupgrade
53-
rev: v3.18.0
53+
rev: v3.19.0
5454
hooks:
5555
- id: pyupgrade
5656
stages: [manual]
@@ -62,6 +62,7 @@ repos:
6262
language: system
6363
types: [python]
6464
args: ["-rn", "-sn", "--fail-on=I"]
65+
require_serial: true
6566
stages: [manual]
6667
- id: rst
6768
name: rst

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ dependencies = [
5151
"exceptiongroup>=1.0.0rc8; python_version<'3.11'",
5252
"iniconfig",
5353
"packaging",
54-
"pluggy<2,>=1.5",
54+
"pluggy>=1.5,<2",
5555
"tomli>=1; python_version<'3.11'",
5656
]
5757
optional-dependencies.dev = [
@@ -275,6 +275,7 @@ disable = [
275275
"too-many-lines",
276276
"too-many-locals",
277277
"too-many-nested-blocks",
278+
"too-many-positional-arguments",
278279
"too-many-public-methods",
279280
"too-many-return-statements", # disabled in ruff
280281
"too-many-statements", # disabled in ruff

src/_pytest/_io/pprint.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ def _format(
111111
p(self, object, stream, indent, allowance, context, level + 1)
112112
context.remove(objid)
113113
elif (
114-
_dataclasses.is_dataclass(object) # type:ignore[unreachable]
114+
_dataclasses.is_dataclass(object)
115115
and not isinstance(object, type)
116-
and object.__dataclass_params__.repr
116+
and object.__dataclass_params__.repr # type:ignore[attr-defined]
117117
and
118118
# Check dataclass has generated repr method.
119119
hasattr(object.__repr__, "__wrapped__")
120120
and "__create_fn__" in object.__repr__.__wrapped__.__qualname__
121121
):
122-
context.add(objid) # type:ignore[unreachable]
122+
context.add(objid)
123123
self._pprint_dataclass(
124124
object, stream, indent, allowance, context, level + 1
125125
)

src/_pytest/capture.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from typing import Any
1616
from typing import AnyStr
1717
from typing import BinaryIO
18+
from typing import cast
1819
from typing import Final
1920
from typing import final
2021
from typing import Generator
@@ -177,7 +178,8 @@ def name(self) -> str:
177178
def mode(self) -> str:
178179
# TextIOWrapper doesn't expose a mode, but at least some of our
179180
# tests check it.
180-
return self.buffer.mode.replace("b", "")
181+
assert hasattr(self.buffer, "mode")
182+
return cast(str, self.buffer.mode.replace("b", ""))
181183

182184

183185
class CaptureIO(io.TextIOWrapper):
@@ -550,7 +552,7 @@ def snap(self) -> bytes:
550552
res = self.tmpfile.buffer.read()
551553
self.tmpfile.seek(0)
552554
self.tmpfile.truncate()
553-
return res
555+
return res # type: ignore[return-value]
554556

555557
def writeorg(self, data: bytes) -> None:
556558
"""Write to original file descriptor."""

testing/test_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ def raiser(exc):
137137
ss.teardown_exact(None)
138138
mod, func = e.value.exceptions
139139
assert isinstance(mod, KeyError)
140-
assert isinstance(func.exceptions[0], TypeError) # type: ignore
141-
assert isinstance(func.exceptions[1], ValueError) # type: ignore
140+
assert isinstance(func.exceptions[0], TypeError)
141+
assert isinstance(func.exceptions[1], ValueError)
142142

143143
def test_cached_exception_doesnt_get_longer(self, pytester: Pytester) -> None:
144144
"""Regression test for #12204 (the "BTW" case)."""

0 commit comments

Comments
 (0)