pytest-doctestplus
pytest-doctestplus copied to clipboard
Consider providing directive for ignoring warnings
In #84 I added a new option +IGNORE_WARNINGS to ignore all warnings from a given line in a doctest. As @bsipocz mentioned in that PR, it might be worth also having a directive that could apply to code blocks, e.g:
.. doctest-ignore-warnings::
>>> ...
Note that we don't need a directive for the whole file since I think that can be done with:
.. testsetup::
>>> import warnings
>>> warnings.simplefilter('ignore')
Before we work on a directive though, I wasn't sure how we should deal with the case where multiple directives apply, e.g. doctest-requires and doctest-ignore-warnings. Is there a preferred syntax for this?