Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #12653

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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]

Check warning on line 122 in src/_pytest/_io/pprint.py

View check run for this annotation

Codecov / codecov/patch

src/_pytest/_io/pprint.py#L122

Added line #L122 was not covered by tests
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 @@
class DontReadFromInput(TextIO):
@property
def encoding(self) -> str:
assert sys.__stdin__ is not None

Check warning on line 205 in src/_pytest/capture.py

View check run for this annotation

Codecov / codecov/patch

src/_pytest/capture.py#L205

Added line #L205 was not covered by tests
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
Loading