Skip to content

Remotedata rst handler #5

Closed
Closed

Description

@MSeifert04

Not sure if this would be a good fit for this package but is it possible to make a code-block-like skip-remote directive that would work like the decorator for the pytest functions, i.e. only runs the doctest if --remote-data has been specified?

Activity

  1. astrofrog commented on Oct 1, 2017

    @astrofrog
    Member

    I might be misunderstanding, but does this not already exist?

    http://docs.astropy.org/en/stable/development/testguide.html?highlight=REMOTE_DATA#working-with-data-files

    specifically:

    >>> datafile = get_data_filename('hash/94935')  # doctest: +REMOTE_DATA

    this works in docstrings and in rst files.

  2. MSeifert04 commented on Oct 1, 2017

    @MSeifert04
    ContributorAuthor

    Ah, I haven't seen that one. I was actually thinking of something like this:

    .. skip-no_remote::
       >>> code that does something with remote-data
       >>> more code that relies on the remote-data access earlier.
    

    But +REMOTE_DATA would also work, it's just more verbose.

  3. bsipocz commented on Oct 1, 2017

    @bsipocz
    Member

    afaik we don't yet have a directive that would work for a block of doctest, either for remote-data or for float_cmp, they would be nice to have additions though.

    Here are the related issues: astropy/astropy#2662 and astropy/astropy#2830

  4. astrofrog commented on Oct 1, 2017

    @astrofrog
    Member

    Ah yes that would be cool!

  5. drdavella commented on Oct 2, 2017

    @drdavella
    Contributor

    I think these probably actually belong in https://github.com/astropy/pytest-doctestplus, although any directive dealing with remote data will introduce a dependency on this plugin.

  6. bsipocz commented on Oct 2, 2017

    @bsipocz
    Member

    all of these will be part of pytest-astropy, so cross dependency shouldn't be a problem I think.

  7. drdavella commented on Oct 2, 2017

    @drdavella
    Contributor

    @bsipocz while that is true, the main motivation for breaking these into separate plugins packages is to make them available to packages a la carte, right? In any case it shouldn't be a big deal because it can just be an optional dependency.

    My main point is that anything that defines a new doctest directive doesn't belong here: it belongs in pytest-doctestplus.

  8. astrofrog commented on Oct 2, 2017

    @astrofrog
    Member

    I agree that this belongs in doctestplus, with a dependency on this package

  9. MSeifert04 commented on Oct 2, 2017

    @MSeifert04
    ContributorAuthor

    will you open an issue there or should I?

  10. drdavella commented on Oct 2, 2017

    @drdavella
    Contributor

    I created two new issues there and will close this one:
    scientific-python/pytest-doctestplus#2
    scientific-python/pytest-doctestplus#3

  11. MSeifert04 commented on Oct 2, 2017

    @MSeifert04
    ContributorAuthor

    Thanks @drdavella

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions