Closed MSeifert04 closed 7 years ago
I might be misunderstanding, but does this not already exist?
specifically:
>>> datafile = get_data_filename('hash/94935') # doctest: +REMOTE_DATA
this works in docstrings and in rst files.
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.
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: https://github.com/astropy/astropy/issues/2662 and https://github.com/astropy/astropy/issues/2830
Ah yes that would be cool!
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.
all of these will be part of pytest-astropy
, so cross dependency shouldn't be a problem I think.
@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.
I agree that this belongs in doctestplus, with a dependency on this package
will you open an issue there or should I?
I created two new issues there and will close this one: https://github.com/astropy/pytest-doctestplus/issues/2 https://github.com/astropy/pytest-doctestplus/issues/3
Thanks @drdavella
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?