pytest_doctest_docutils¶
pytest_doctest_docutils lets pytest collect doctests from .rst and
.md files. Point pytest at a documentation file or directory, and the plugin
parses each page through doctest_docutils before pytest runs the
examples.
The plugin blocks pytest’s standard doctest plugin by default so the same examples are not collected twice.
Tutorial
Run documentation doctests through pytest.
How-to
Collect docs, Python modules, and option-flagged examples.
Fixtures
Share setup through doctest_namespace and autouse fixtures.
API Reference
Inspect collector, runner, and pytest hook APIs.
Default command¶
Run documentation doctests under docs/:
$ pytest docs/