From 48cb8a2b329d0e8beaf30804c503eddb5e531385 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 22:31:18 +0000 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#12380) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.4 → v0.4.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.4...v0.4.5) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- src/_pytest/_code/code.py | 4 ++-- src/_pytest/config/__init__.py | 2 +- src/_pytest/doctest.py | 2 +- src/_pytest/threadexception.py | 4 ++-- src/_pytest/unraisableexception.py | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f20f61761..64bdbb36a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.4" + rev: "v0.4.5" hooks: - id: ruff args: ["--fix"] diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index cfa226bb7..4fb686a86 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -199,8 +199,8 @@ class TracebackEntry: rawentry: TracebackType, repr_style: Optional['Literal["short", "long"]'] = None, ) -> None: - self._rawentry: "Final" = rawentry - self._repr_style: "Final" = repr_style + self._rawentry: Final = rawentry + self._repr_style: Final = repr_style def with_repr_style( self, repr_style: Optional['Literal["short", "long"]'] diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index c698ea9a7..f3d3b3062 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1913,7 +1913,7 @@ def parse_warning_filter( parts.append("") action_, message, category_, module, lineno_ = (s.strip() for s in parts) try: - action: "warnings._ActionKind" = warnings._getaction(action_) # type: ignore[attr-defined] + action: warnings._ActionKind = warnings._getaction(action_) # type: ignore[attr-defined] except warnings._OptionError as e: raise UsageError(error_template.format(error=str(e))) from None try: diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index 35a136762..2d7453b4e 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -298,7 +298,7 @@ class DoctestItem(Item): def runtest(self) -> None: _check_all_skipped(self.dtest) self._disable_output_capturing_for_darwin() - failures: List["doctest.DocTestFailure"] = [] + failures: List[doctest.DocTestFailure] = [] # Type ignored because we change the type of `out` from what # doctest expects. self.runner.run(self.dtest, out=failures) # type: ignore[arg-type] diff --git a/src/_pytest/threadexception.py b/src/_pytest/threadexception.py index 09faf661b..603a1777c 100644 --- a/src/_pytest/threadexception.py +++ b/src/_pytest/threadexception.py @@ -34,8 +34,8 @@ class catch_threading_exception: """ def __init__(self) -> None: - self.args: Optional["threading.ExceptHookArgs"] = None - self._old_hook: Optional[Callable[["threading.ExceptHookArgs"], Any]] = None + self.args: Optional[threading.ExceptHookArgs] = None + self._old_hook: Optional[Callable[[threading.ExceptHookArgs], Any]] = None def _hook(self, args: "threading.ExceptHookArgs") -> None: self.args = args diff --git a/src/_pytest/unraisableexception.py b/src/_pytest/unraisableexception.py index f649267ab..50b121e88 100644 --- a/src/_pytest/unraisableexception.py +++ b/src/_pytest/unraisableexception.py @@ -34,8 +34,8 @@ class catch_unraisable_exception: """ def __init__(self) -> None: - self.unraisable: Optional["sys.UnraisableHookArgs"] = None - self._old_hook: Optional[Callable[["sys.UnraisableHookArgs"], Any]] = None + self.unraisable: Optional[sys.UnraisableHookArgs] = None + self._old_hook: Optional[Callable[[sys.UnraisableHookArgs], Any]] = None def _hook(self, unraisable: "sys.UnraisableHookArgs") -> None: # Storing unraisable.object can resurrect an object which is being