diff --git a/src/manuel/bugs.txt b/src/manuel/bugs.txt index 40b4945..735643e 100644 --- a/src/manuel/bugs.txt +++ b/src/manuel/bugs.txt @@ -218,6 +218,34 @@ instead: +OutputChecker and debug +----------------------- + +When running in debug mode, such as when using the ``-D`` option of +``zope.testrunner``, the ``outputchecker`` of ``manuel.doctest.Manuel`` +was ignored. + +.. code-block:: python + import doctest + import os.path + import manuel.doctest + import manuel.testing + doc = os.path.join(__file__, '..', 'doc3.ex') + + checked_outputs = [] + class CustomChecker(doctest.OutputChecker): + def check_output(self, want, got, optionflags): + checked_outputs.append((want, got)) + return True + + + m = manuel.doctest.Manuel(checker=CustomChecker()) + >>> suite = manuel.testing.TestSuite(m, doc) + >>> suite.debug() + >>> checked_outputs + [('2\n', '1\n')] + + DocTestRunner peaks at sys.argv ------------------------------- diff --git a/src/manuel/doctest.py b/src/manuel/doctest.py index aee4310..15955ef 100644 --- a/src/manuel/doctest.py +++ b/src/manuel/doctest.py @@ -103,7 +103,9 @@ def __init__(self, optionflags=0, checker=None, parser=None): self.runner = DocTestRunner( optionflags=optionflags, checker=checker, verbose=False ) - self.debug_runner = DebugRunner(optionflags=optionflags, verbose=False) + self.debug_runner = DebugRunner( + optionflags=optionflags, checker=checker, verbose=False + ) def evaluate_closure(region, document, globs): # capture "self"