Skip to content

Commit dd6d4b2

Browse files
authored
Merge pull request #9128 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents e3efbd4 + 56fda99 commit dd6d4b2

File tree

7 files changed

+15
-19
lines changed

7 files changed

+15
-19
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ repos:
3434
- id: reorder-python-imports
3535
args: ['--application-directories=.:src', --py36-plus]
3636
- repo: https://github.com/asottile/pyupgrade
37-
rev: v2.26.0
37+
rev: v2.28.0
3838
hooks:
3939
- id: pyupgrade
4040
args: [--py36-plus]

src/_pytest/config/argparsing.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,7 @@ def __init__(
392392
prog: Optional[str] = None,
393393
) -> None:
394394
self._parser = parser
395-
argparse.ArgumentParser.__init__(
396-
self,
395+
super().__init__(
397396
prog=prog,
398397
usage=parser._usage,
399398
add_help=False,
@@ -486,7 +485,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
486485
super().__init__(*args, **kwargs)
487486

488487
def _format_action_invocation(self, action: argparse.Action) -> str:
489-
orgstr = argparse.HelpFormatter._format_action_invocation(self, action)
488+
orgstr = super()._format_action_invocation(action)
490489
if orgstr and orgstr[0] != "-": # only optional arguments
491490
return orgstr
492491
res: Optional[str] = getattr(action, "_formatted_action_invocation", None)

src/_pytest/doctest.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ def __init__(
190190
optionflags: int = 0,
191191
continue_on_failure: bool = True,
192192
) -> None:
193-
doctest.DebugRunner.__init__(
194-
self, checker=checker, verbose=verbose, optionflags=optionflags
193+
super().__init__(checker=checker, verbose=verbose, optionflags=optionflags
195194
)
196195
self.continue_on_failure = continue_on_failure
197196

@@ -513,8 +512,7 @@ def _find_lineno(self, obj, source_lines):
513512
if isinstance(obj, property):
514513
obj = getattr(obj, "fget", obj)
515514
# Type ignored because this is a private function.
516-
return doctest.DocTestFinder._find_lineno( # type: ignore
517-
self,
515+
return super()._find_lineno(
518516
obj,
519517
source_lines,
520518
)
@@ -527,8 +525,7 @@ def _find(
527525
with _patch_unwrap_mock_aware():
528526

529527
# Type ignored because this is a private function.
530-
doctest.DocTestFinder._find( # type: ignore
531-
self, tests, obj, name, module, source_lines, globs, seen
528+
super()._find(tests, obj, name, module, source_lines, globs, seen
532529
)
533530

534531
if self.path.name == "conftest.py":
@@ -613,7 +610,7 @@ class LiteralsOutputChecker(doctest.OutputChecker):
613610
)
614611

615612
def check_output(self, want: str, got: str, optionflags: int) -> bool:
616-
if doctest.OutputChecker.check_output(self, want, got, optionflags):
613+
if super().check_output(want, got, optionflags):
617614
return True
618615

619616
allow_unicode = optionflags & _get_allow_unicode_flag()
@@ -637,7 +634,7 @@ def remove_prefixes(regex: Pattern[str], txt: str) -> str:
637634
if allow_number:
638635
got = self._remove_unwanted_precision(want, got)
639636

640-
return doctest.OutputChecker.check_output(self, want, got, optionflags)
637+
return super().check_output(want, got, optionflags)
641638

642639
def _remove_unwanted_precision(self, want: str, got: str) -> str:
643640
wants = list(self._number_re.finditer(want))

src/_pytest/logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ def __init__(
784784
terminal_reporter: TerminalReporter,
785785
capture_manager: Optional[CaptureManager],
786786
) -> None:
787-
logging.StreamHandler.__init__(self, stream=terminal_reporter) # type: ignore[arg-type]
787+
super().__init__(stream=terminal_reporter) # type: ignore[arg-type]
788788
self.capture_manager = capture_manager
789789
self.reset()
790790
self.set_when(None)

src/_pytest/outcomes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self, msg: Optional[str] = None, pytrace: bool = True) -> None:
3333
"Perhaps you meant to use a mark?"
3434
)
3535
raise TypeError(error_msg.format(type(self).__name__, type(msg).__name__))
36-
BaseException.__init__(self, msg)
36+
super().__init__(msg)
3737
self.msg = msg
3838
self.pytrace = pytrace
3939

@@ -61,7 +61,7 @@ def __init__(
6161
*,
6262
_use_item_location: bool = False,
6363
) -> None:
64-
OutcomeException.__init__(self, msg=msg, pytrace=pytrace)
64+
super().__init__(msg=msg, pytrace=pytrace)
6565
self.allow_module_level = allow_module_level
6666
# If true, the skip location is reported as the item's location,
6767
# instead of the place that raises the exception/calls skip().

src/_pytest/python_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def __eq__(self, actual) -> bool:
221221
if not np.isscalar(actual) and actual.shape != self.expected.shape:
222222
return False
223223

224-
return ApproxBase.__eq__(self, actual)
224+
return super().__eq__(actual)
225225

226226
def _yield_comparisons(self, actual):
227227
import numpy as np
@@ -292,7 +292,7 @@ def __eq__(self, actual) -> bool:
292292
except AttributeError:
293293
return False
294294

295-
return ApproxBase.__eq__(self, actual)
295+
return super().__eq__(actual)
296296

297297
def _yield_comparisons(self, actual):
298298
for k in self.expected.keys():
@@ -365,7 +365,7 @@ def __eq__(self, actual) -> bool:
365365
return False
366366
except TypeError:
367367
return False
368-
return ApproxBase.__eq__(self, actual)
368+
return super().__eq__(actual)
369369

370370
def _yield_comparisons(self, actual):
371371
return zip(actual, self.expected)

src/_pytest/unittest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def runtest(self) -> None:
322322
def _prunetraceback(
323323
self, excinfo: _pytest._code.ExceptionInfo[BaseException]
324324
) -> None:
325-
Function._prunetraceback(self, excinfo)
325+
super()._prunetraceback(excinfo)
326326
traceback = excinfo.traceback.filter(
327327
lambda x: not x.frame.f_globals.get("__unittest")
328328
)

0 commit comments

Comments
 (0)