Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#12380)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.4 → v0.4.5](astral-sh/ruff-pre-commit@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>
  • Loading branch information
pre-commit-ci[bot] authored May 27, 2024
1 parent 88fae23 commit 48cb8a2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .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.4.4"
rev: "v0.4.5"
hooks:
- id: ruff
args: ["--fix"]
Expand Down
4 changes: 2 additions & 2 deletions src/_pytest/_code/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ def __init__(
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"]']
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def setup(self) -> None:
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]
Expand Down
4 changes: 2 additions & 2 deletions src/_pytest/threadexception.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/_pytest/unraisableexception.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 48cb8a2

Please sign in to comment.