LinearLeopard
LinearLeopard

Reputation: 778

doctest running in sphinx doc

I am trying to run doctest written in my rst doc. But I can't get how to run it. I've written the following:

.. doctest::

    >>> 43 + 1
    45

And then I do:

$ make html

but doc is build successfully.

I am also interested if the one can just run test without building html doc?

Thank you in advance.

Upvotes: 2

Views: 788

Answers (1)

LinearLeopard
LinearLeopard

Reputation: 778

So, that was actually not that hard. I should just run the following command:

$ pytest 'path to static rst files' --doctest-glob=*.rst --doctest-module

Upvotes: 1

Related Questions