A doctest plugin for pytest, which understands the sphinx-specific directives from doctest-sphinx. Those sphinx-specific directives can be used in rst files as well as in docstrings of python modules.
- support for the
doctestdirective - support for
testcodeandtestoutputdirectives - support for
testsetupandtestcleanupis planned (pull-requests welcome) - support for parsing global optionflags (
doctest_optionflags) frompytest.ini - support for
:options:intestoutput - support for
:skipif:intestcodeand intestoutput :hide:is ignored by "pytest-sphinx"
- pytest
You can install "pytest-sphinx" via pip from PyPI:
$ pip install pytest-sphinx
- See doctest-sphinx. Have a look at the examples in doctest-examples.
- Run pytest with the --doctest-modules flag.
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
Distributed under the terms of the BSD-3 license, "pytest-sphinx" is free and open source software
If you encounter any problems, please file an issue along with a detailed description.