-
Notifications
You must be signed in to change notification settings - Fork 37
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
add directive to enable something like "skip if" #16
Comments
@eteq - wouldn't the |
Sympy's test runner has solved this using a decorator to mark a particular function/class for skipping. You can see the decorator here: https://github.com/sympy/sympy/blob/sympy-1.3/sympy/utilities/decorator.py#L130 Also an example of use is here: https://github.com/sympy/sympy/blob/sympy-1.3/sympy/printing/preview.py#L23 I'm not sure if doctestplus should grow something as complicated as that but certainly a decorator for skipping doctests would be useful. As long as doctestplus has the machinery to skip doctests from a marked function then downstream projects can extend that with as much conditional functionality as they like. So I would suggest just to keep it simple and add a decorator called |
sphinx-doc/sphinx#5307 is also a potential implementation and closer to the restructuretext bits |
as per my comment above I think we have this functionality already. At least for that was my understanding reading the narrative of the OP. Reading the example is something else though, so if you indeed mean adding functionality that SKIPs when something is installed, then please reopen and provide more details about the use case you have in mind. |
A constant thorn in our side when writing doc tests for
astropy.coordinates
is the need to# doctest: +SKIP
anything that uses scipy, since it's an optional dependency. It would be better if we could do something like# doctest: +SKIP_IF_HAS_SCIPY
. doctestplus might be a good place for this, but the challenge is: how to define this sensibly? ideally one would have a skipif that's fairly generic, not hard-coded to Scipy...cc @drdavella
The text was updated successfully, but these errors were encountered: