Skip to content
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,7 +1,7 @@
minimum_pre_commit_version: "4.4.0"
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.15.8"
rev: "v0.15.9"
hooks:
- id: ruff-check
args: ["--fix"]
Expand Down Expand Up @@ -34,7 +34,7 @@ repos:
hooks:
- id: python-use-type-annotations
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
rev: v1.20.0
hooks:
- id: mypy
files: ^(src/|testing/|scripts/)
Expand Down
3 changes: 1 addition & 2 deletions src/_pytest/raises.py
Original file line number Diff line number Diff line change
Expand Up @@ -1482,8 +1482,7 @@ def set_result(self, expected: int, actual: int, result: str | None) -> None:
def get_result(self, expected: int, actual: int) -> str | None:
res = self.results[actual][expected]
assert res is not NotChecked
# mypy doesn't support identity checking against anything but None
return res # type: ignore[return-value]
return res

def has_result(self, expected: int, actual: int) -> bool:
return self.results[actual][expected] is not NotChecked
Expand Down
4 changes: 2 additions & 2 deletions testing/code/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class TestExceptionInfo:
def test_bad_getsource(self) -> None:
try:
if False:
pass
pass # type: ignore[unreachable]
else:
assert False
except AssertionError:
Expand All @@ -164,7 +164,7 @@ class TestTracebackEntry:
def test_getsource(self) -> None:
try:
if False:
pass
pass # type: ignore[unreachable]
else:
assert False
except AssertionError:
Expand Down
2 changes: 1 addition & 1 deletion testing/code/test_excinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def func1(m):
reprfuncargs = p.repr_args(entry)
assert reprfuncargs is not None
assert reprfuncargs.args[0] == ("m", repr("m" * 500))
assert "..." not in cast(str, reprfuncargs.args[0][1])
assert "..." not in reprfuncargs.args[0][1]

def test_repr_tracebackentry_lines(self, importasmod) -> None:
mod = importasmod(
Expand Down
2 changes: 1 addition & 1 deletion testing/test_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ def test_dontreadfrominput() -> None:

f = DontReadFromInput()
assert f.buffer is f # type: ignore[comparison-overlap]
assert not f.isatty()
assert not f.isatty() # type: ignore[unreachable]
pytest.raises(OSError, f.read)
pytest.raises(OSError, f.readlines)
iter_f = iter(f)
Expand Down
1 change: 1 addition & 0 deletions testing/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def test_foo(self):
assert isinstance(fn, pytest.Function)

assert fn.getparent(pytest.Module) is modcol
assert modcol is not None
assert modcol.module is not None
assert modcol.cls is None
assert modcol.instance is None
Expand Down