Skip to content

Consider providing directive for ignoring warnings #85

Open

Description

@astrofrog

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions