Skip to content

Commit

Permalink
Merge pull request pytest-dev#12653 from pytest-dev/pre-commit-ci-upd…
Browse files Browse the repository at this point in the history
…ate-config

[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
nicoddemus authored Jul 23, 2024
2 parents 643845f + 69a4a71 commit 8061af8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.2"
rev: "v0.5.4"
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -21,7 +21,7 @@ repos:
hooks:
- id: python-use-type-annotations
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
rev: v1.11.0
hooks:
- id: mypy
files: ^(src/|testing/|scripts/)
Expand Down
4 changes: 2 additions & 2 deletions src/_pytest/_io/pprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ def _format(
p(self, object, stream, indent, allowance, context, level + 1)
context.remove(objid)
elif (
_dataclasses.is_dataclass(object)
_dataclasses.is_dataclass(object) # type:ignore[unreachable]
and not isinstance(object, type)
and object.__dataclass_params__.repr
and
# Check dataclass has generated repr method.
hasattr(object.__repr__, "__wrapped__")
and "__create_fn__" in object.__repr__.__wrapped__.__qualname__
):
context.add(objid)
context.add(objid) # type:ignore[unreachable]
self._pprint_dataclass(
object, stream, indent, allowance, context, level + 1
)
Expand Down
1 change: 1 addition & 0 deletions src/_pytest/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def write(self, s: str) -> int:
class DontReadFromInput(TextIO):
@property
def encoding(self) -> str:
assert sys.__stdin__ is not None
return sys.__stdin__.encoding

def read(self, size: int = -1) -> str:
Expand Down
1 change: 1 addition & 0 deletions src/_pytest/faulthandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def get_stderr_fileno() -> int:
# pytest-xdist monkeypatches sys.stderr with an object that is not an actual file.
# https://docs.python.org/3/library/faulthandler.html#issue-with-file-descriptors
# This is potentially dangerous, but the best we can do.
assert sys.__stderr__ is not None
return sys.__stderr__.fileno()


Expand Down
2 changes: 1 addition & 1 deletion testing/test_assertion.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ def __setitem__(self, item, value):
def __delitem__(self, item):
pass

def insert(self, item, index):
def insert(self, index, value):
pass

expl = callequal(TestSequence([0, 1]), list([0, 2]))
Expand Down
2 changes: 1 addition & 1 deletion testing/test_monkeypatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def test_context() -> None:
with monkeypatch.context() as m:
m.setattr(functools, "partial", 3)
assert not inspect.isclass(functools.partial)
assert inspect.isclass(functools.partial)
assert inspect.isclass(functools.partial) # type:ignore[unreachable]


def test_context_classmethod() -> None:
Expand Down

0 comments on commit 8061af8

Please sign in to comment.