Skip to content

Commit

Permalink
Merge pull request #126 from ev-br/use_super
Browse files Browse the repository at this point in the history
MAINT: use super() in DTRunner
  • Loading branch information
ev-br authored Feb 26, 2024
2 parents a79e646 + 73b9f2f commit 33e85a4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions scpdt/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ def __init__(self, checker=None, verbose=None, optionflags=None, config=None):
self.nameerror_after_exception = config.nameerror_after_exception
if optionflags is None:
optionflags = config.optionflags
doctest.DocTestRunner.__init__(self, checker=checker, verbose=verbose,
optionflags=optionflags)
super().__init__(checker=checker, verbose=verbose, optionflags=optionflags)

def _report_item_name(self, out, item_name, new_line=False):
if item_name is not None:
Expand All @@ -344,12 +343,12 @@ def _report_item_name(self, out, item_name, new_line=False):
out("\n")

def report_start(self, out, test, example):
return doctest.DocTestRunner.report_start(self, out, test, example)
return super().report_start(out, test, example)

def report_success(self, out, test, example, got):
if self._verbose:
self._report_item_name(out, test.name, new_line=True)
return doctest.DocTestRunner.report_success(self, out, test, example, got)
return super().report_success(out, test, example, got)

def report_unexpected_exception(self, out, test, example, exc_info):
if not self.nameerror_after_exception:
Expand All @@ -367,8 +366,7 @@ def report_unexpected_exception(self, out, test, example, exc_info):

def report_failure(self, out, test, example, got):
self._report_item_name(out, test.name)
return doctest.DocTestRunner.report_failure(self, out, test,
example, got)
return super().report_failure(out, test, example, got)

def get_history(self):
"""Return a dict with names of items which were run.
Expand Down

0 comments on commit 33e85a4

Please sign in to comment.