Skip to content

Fix usage of +IGNORE_WARNING directive with the ..doctest-remote-data :: directive #147

Closed

Description

@tinuademargaret

@saimn @pllim - we're kind of stuck here. This code chunck is skipped as expected with the new directive, but the test comes back as "passed" rather than "skipped". Have you recall any similar situation, or the reason for this?

Originally posted by @bsipocz in #137 (comment)

Activity

  1. changed the title [-]Fix: Usage of `+IGNORE_WARNING` directive with the `..doctest-remote-data ::` directive[/-] [+]Fix usage of `+IGNORE_WARNING` directive with the `..doctest-remote-data ::` directive[/+] on Jan 12, 2021
  2. tinuademargaret commented on Jan 12, 2021

    @tinuademargaret
    ContributorAuthor

    Testing the new remote data directive with the +IGNORE_WARNINGS directive, the test should be skipped if remote data is not requested. It is skipped but the assertion outcome is passed instead of skipped.

  3. saimn commented on Jan 15, 2021

    @saimn
    Contributor

    Can you explain more in detail the issue ? It's not clear to me from the other PR.

  4. pllim commented on Jan 15, 2021

    @pllim
    Contributor

    tl;dr -- A test that should have been skipped is shown as passed even when it is skipped, which is very misleading. Only happens when the embedded code has +IGNORE_WARNINGS directive. If you run this with #137 , you can see the behavior. Run it with and without +IGNORE_WARNINGS to see the difference.

    Content of testme.rst:

    #This test is skipped when remote data is not requested, as it should
    #but when remote data is requested the +FLOAT_CMP directive fails
    
    .. doctest-remote-data::
    
        >>> x = 1/3.
        >>> x    # doctest: +FLOAT_CMP +IGNORE_WARNING
        0.333333
        #
        # do some failing to check whether the whole block is indeed skipped
        >>> 1 + 1
        3
    
    • pytest testme.rst --doctest-plus --doctest-rst --remote-data fails as expected.
    • pytest testme.rst --doctest-plus --doctest-rst with +IGNORE_WARNINGS shows it as passing (green) -- WRONG
    • pytest testme.rst --doctest-plus --doctest-rst without +IGNORE_WARNINGS shows it as skipped (yellow) -- CORRECT
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