Skip to content
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

Consider providing directive for ignoring warnings #85

Open
astrofrog opened this issue Nov 12, 2019 · 0 comments
Open

Consider providing directive for ignoring warnings #85

astrofrog opened this issue Nov 12, 2019 · 0 comments

Comments

@astrofrog
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants