There is a doctest_depends_on decorator that you can put on the function.

I don't think there's any way to do it for the doctests in the Sphinx
docs.  For those you'll just have to skip them.

Aaron Meurer

On Mon, Jan 4, 2016 at 10:53 AM, Tanu Hari Dixit <[email protected]> wrote:
> Is there a way to have optional doctests that depend on optional
> dependencies
> so that they are executed when the optional dependency is present and
> skipped when not?
> @skipif of pytest [1] or @skipIf of unittest [2] library work for tests and
> not doctests.
> Does a similar functionality exist for doctest?
>
> [1]https://github.com/astropy/astropy/blob/master/docs/development/testguide.rst#tests-requiring-optional-dependencies
> [2]https://docs.djangoproject.com/en/1.4/topics/testing/#skipping-tests
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/a806ee0f-bbe9-41aa-b316-1eb17f47ed76%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6KOz0oL1%2B8WzcX0tMD2RQm9WkiysjOxyaZYLhsjE4xnRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to