doctest_docutils

doctest_docutils runs Python doctest examples from documentation files. It parses reStructuredText through docutils and Markdown through myst-parser, then collects the examples a reader sees in the page.

Use this module when you want a direct command for a single documentation file. Use pytest_doctest_docutils when you want pytest collection, fixtures, and suite-level reporting.

Tutorial

Run your first documentation doctest from a Markdown page.

Tutorial
How-to

Choose files, run verbose output, and map the command to stdlib doctest.

How-to
Examples

See the supported Markdown and reStructuredText example shapes.

Examples
API Reference

Inspect finder, runner, directive, and CLI APIs.

API reference

Default command

Run a Markdown page:

$ python -m doctest_docutils README.md

No output means the examples passed. Add -v when you want the standard doctest transcript.