From 40d9601b27a0c2e105e96a1c0a864d2c9bfbd31b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2026 22:20:16 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.16.10 → v0.17.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.16.10...v0.17.0) - [github.com/asottile/pyupgrade: v3.21.2 → v3.22.0](https://github.com/asottile/pyupgrade/compare/v3.21.2...v3.22.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0ff8e6eb91b..497860d716d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ minimum_pre_commit_version: "4.4.0" repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.16.10" + rev: "v0.17.0" hooks: - id: ruff-check args: ["--fix"] @@ -74,7 +74,7 @@ repos: # https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version additional_dependencies: ["tox>=4.9"] - repo: https://github.com/asottile/pyupgrade - rev: v3.21.2 + rev: v3.22.0 hooks: - id: pyupgrade args: From dc5438271035807a851e0bdaf0977387ad874220 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2026 22:21:50 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/assertion/rewrite.py | 4 +--- testing/test_assertrewrite.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index 476ea9c3547..aff2060dbaf 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -57,9 +57,7 @@ try: - from _imp import ( # type: ignore[attr-defined] - _fix_co_filename as _imp_fix_co_filename, - ) + from _imp import _fix_co_filename as _imp_fix_co_filename # type: ignore[attr-defined] except ImportError: # pragma: no cover _imp_fix_co_filename = None diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 47792df79fc..4145be13842 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1173,9 +1173,7 @@ def test_moved_test_file_updates_code_filename( The rewritten pyc is reused: filenames are corrected in memory, not by rewriting the cache. """ - from _pytest.assertion.rewrite import ( # type: ignore[attr-defined] - _imp_fix_co_filename, - ) + from _pytest.assertion.rewrite import _imp_fix_co_filename # type: ignore[attr-defined] monkeypatch.delenv("PYTHONDONTWRITEBYTECODE", raising=False) monkeypatch.delenv("PYTHONPYCACHEPREFIX", raising=False)