Skip to content

Commit c7be6c5

Browse files
committed
Don't report fail/success and auto-enable doctest-only
1 parent 58c3213 commit c7be6c5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pytest_doctestplus/plugin.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ def _is_numpy_ufunc(method):
208208
def pytest_configure(config):
209209
doctest_plugin = config.pluginmanager.getplugin('doctest')
210210
run_regular_doctest = config.option.doctestmodules and not config.option.doctest_plus
211+
if config.option.doctest_plus_generate_diff:
212+
config.option.doctest_only = True
211213
use_doctest_plus = config.getini(
212214
'doctest_plus') or config.option.doctest_plus or config.option.doctest_only
213215
use_doctest_ufunc = config.getini(
@@ -890,13 +892,15 @@ def __init__(self, checker=None, verbose=None, optionflags=0,
890892

891893
def report_success(self, out, test, example, got):
892894
if self._generate_diff:
893-
return self.track_diff(True, out, test, example, got)
895+
self.track_diff(False, out, test, example, got)
896+
return
894897

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

897900
def report_failure(self, out, test, example, got):
898901
if self._generate_diff:
899-
self.track_diff(False, out, test, example, got)
902+
self.track_diff(True, out, test, example, got)
903+
return
900904

901905
failure = doctest.DocTestFailure(test, example, got)
902906
if self.continue_on_failure:

0 commit comments

Comments
 (0)