Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 20, 2024
1 parent fc6ba92 commit 80e4b18
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
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 @@ -200,8 +200,8 @@ def __init__(
rawentry: TracebackType,
repr_style: Literal["short", "long"] | None = 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: Literal["short", "long"] | None
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 @@ -1906,7 +1906,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 @@ -294,7 +294,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
5 changes: 4 additions & 1 deletion src/_pytest/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,10 @@ def _register_fixture(
name: str,
func: _FixtureFunc[object],
nodeid: str | None,
scope: Scope | _ScopeName | Callable[[str, Config], _ScopeName] | None = "function",
scope: Scope
| _ScopeName
| Callable[[str, Config], _ScopeName]
| None = "function",
params: Sequence[object] | None = None,
ids: tuple[object | None, ...] | Callable[[Any], object | None] | None = None,
autouse: bool = False,
Expand Down
8 changes: 4 additions & 4 deletions src/_pytest/unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def teardown(self) -> None:
def startTest(self, testcase: unittest.TestCase) -> None:
pass

def _addexcinfo(self, rawexcinfo: "_SysExcInfoType") -> None:
def _addexcinfo(self, rawexcinfo: _SysExcInfoType) -> None:
# Unwrap potential exception info (see twisted trial support below).
rawexcinfo = getattr(rawexcinfo, "_rawexcinfo", rawexcinfo)
try:
Expand Down Expand Up @@ -258,7 +258,7 @@ def _addexcinfo(self, rawexcinfo: "_SysExcInfoType") -> None:
self.__dict__.setdefault("_excinfo", []).append(excinfo)

def addError(
self, testcase: unittest.TestCase, rawexcinfo: "_SysExcInfoType"
self, testcase: unittest.TestCase, rawexcinfo: _SysExcInfoType
) -> None:
try:
if isinstance(rawexcinfo[1], exit.Exception):
Expand All @@ -268,7 +268,7 @@ def addError(
self._addexcinfo(rawexcinfo)

def addFailure(
self, testcase: unittest.TestCase, rawexcinfo: "_SysExcInfoType"
self, testcase: unittest.TestCase, rawexcinfo: _SysExcInfoType
) -> None:
self._addexcinfo(rawexcinfo)

Expand All @@ -281,7 +281,7 @@ def addSkip(self, testcase: unittest.TestCase, reason: str) -> None:
def addExpectedFailure(
self,
testcase: unittest.TestCase,
rawexcinfo: "_SysExcInfoType",
rawexcinfo: _SysExcInfoType,
reason: str = "",
) -> None:
try:
Expand Down

0 comments on commit 80e4b18

Please sign in to comment.