Skip to content

Commit 8061af8

Browse files
authored
Merge pull request #12653 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents 643845f + 69a4a71 commit 8061af8

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

.pre-commit-config.yaml

+2-2
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.5.2"
3+
rev: "v0.5.4"
44
hooks:
55
- id: ruff
66
args: ["--fix"]
@@ -21,7 +21,7 @@ repos:
2121
hooks:
2222
- id: python-use-type-annotations
2323
- repo: https://github.com/pre-commit/mirrors-mypy
24-
rev: v1.10.1
24+
rev: v1.11.0
2525
hooks:
2626
- id: mypy
2727
files: ^(src/|testing/|scripts/)

src/_pytest/_io/pprint.py

+2-2
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)
114+
_dataclasses.is_dataclass(object) # type:ignore[unreachable]
115115
and not isinstance(object, type)
116116
and object.__dataclass_params__.repr
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)
122+
context.add(objid) # type:ignore[unreachable]
123123
self._pprint_dataclass(
124124
object, stream, indent, allowance, context, level + 1
125125
)

src/_pytest/capture.py

+1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ def write(self, s: str) -> int:
202202
class DontReadFromInput(TextIO):
203203
@property
204204
def encoding(self) -> str:
205+
assert sys.__stdin__ is not None
205206
return sys.__stdin__.encoding
206207

207208
def read(self, size: int = -1) -> str:

src/_pytest/faulthandler.py

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def get_stderr_fileno() -> int:
6464
# pytest-xdist monkeypatches sys.stderr with an object that is not an actual file.
6565
# https://docs.python.org/3/library/faulthandler.html#issue-with-file-descriptors
6666
# This is potentially dangerous, but the best we can do.
67+
assert sys.__stderr__ is not None
6768
return sys.__stderr__.fileno()
6869

6970

testing/test_assertion.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ def __setitem__(self, item, value):
823823
def __delitem__(self, item):
824824
pass
825825

826-
def insert(self, item, index):
826+
def insert(self, index, value):
827827
pass
828828

829829
expl = callequal(TestSequence([0, 1]), list([0, 2]))

testing/test_monkeypatch.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def test_context() -> None:
415415
with monkeypatch.context() as m:
416416
m.setattr(functools, "partial", 3)
417417
assert not inspect.isclass(functools.partial)
418-
assert inspect.isclass(functools.partial)
418+
assert inspect.isclass(functools.partial) # type:ignore[unreachable]
419419

420420

421421
def test_context_classmethod() -> None:

0 commit comments

Comments
 (0)