Skip to content

Any hints as to how to override the OutputChecker #223

@matthew-brett

Description

@matthew-brett

We (over at https://github.com/nipy/nipy) have a customized doctest OutputChecker class for a few new directives - https://github.com/matthew-brett/nipy/blob/pytest/nipy/conftest.py#L152

I have tried to apply this output checker by monkey-patching doctest in conftest.py:

doctest.OutputChecker = NipyOutputChecker

I can see, with a debug test in a .py file, that shows me that, when I get to the doctest, doctest.OutputChecker is my checker.

https://github.com/matthew-brett/nipy/blob/pytest/nipy/algorithms/statistics/formula/formulae.py#L95

But the checkers check_output never gets called.

I wondered idly whether this is because y'all enforce your OutputChecker in DoctestModulePlus:

https://github.com/scientific-python/pytest-doctestplus/blob/main/pytest_doctestplus/plugin.py#L268

What is the best way to plumb in my OutputChecker, when using pytest-doctestplus?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions