-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any hints as to how to override the OutputChecker #223
Comments
You mean, you want to use your own custom doctest directives on top of what doctestplus provides? |
I wonder if what you have can be merged into this package (unless they duplicate existing functionality). Though the |
Yes - exactly - in my case I want to extend the options available to the doctest processing - and to do that - I need to change the https://docs.python.org/3/library/doctest.html#doctest.DocTestRunner I can certainly make a PR with the code we have, and make |
I see that it would be moderately difficult to do - but it would be very useful. |
Not sure if there is a good way to do it, given the way it's done currently 😬 |
Is this still relevant @matthew-brett ? |
I spent some time trying to weave my way into the depths of monkey-patching, before giving up, and accepting the constraints of doctest-plus for doctesting. So - yes - still relevant - but I don't have any great wisdom on how the output checking should best be extended here. |
Not sure how to do it with pytest-doctestplus either. Do you feel like giving an alternative a go? |
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#L152I have tried to apply this output checker by monkey-patching
doctest
inconftest.py
: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
inDoctestModulePlus
: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
?The text was updated successfully, but these errors were encountered: