Skip to content

Commit

Permalink
Don't report fail/success and auto-enable doctest-only
Browse files Browse the repository at this point in the history
  • Loading branch information
seberg committed Dec 9, 2023
1 parent 58c3213 commit c7be6c5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pytest_doctestplus/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ def _is_numpy_ufunc(method):
def pytest_configure(config):
doctest_plugin = config.pluginmanager.getplugin('doctest')
run_regular_doctest = config.option.doctestmodules and not config.option.doctest_plus
if config.option.doctest_plus_generate_diff:
config.option.doctest_only = True
use_doctest_plus = config.getini(
'doctest_plus') or config.option.doctest_plus or config.option.doctest_only
use_doctest_ufunc = config.getini(
Expand Down Expand Up @@ -890,13 +892,15 @@ def __init__(self, checker=None, verbose=None, optionflags=0,

def report_success(self, out, test, example, got):
if self._generate_diff:
return self.track_diff(True, out, test, example, got)
self.track_diff(False, out, test, example, got)
return

return super().report_success(out, test, example, got)

def report_failure(self, out, test, example, got):
if self._generate_diff:
self.track_diff(False, out, test, example, got)
self.track_diff(True, out, test, example, got)
return

failure = doctest.DocTestFailure(test, example, got)
if self.continue_on_failure:
Expand Down

0 comments on commit c7be6c5

Please sign in to comment.