Status: Archived

This repository has been archived and is no longer maintained

Use python -m doctest README.rst instead

readmetester

Status Inactive License PyPI CI pre-commit.ci status CodeQL codecov.io readthedocs.org python3.8 Black pylint

Parse, test, and assert RST code-blocks

Installation

$ pip install readmetester

Usage

readmetester [-h] [--version] [README.rst]

If a README.rst file is present in the current working directory it will be used if no arguments are provided

$ readmetester README.rst

Documenting

Python code begins with ">>> "

Continuation lines begin with "... "

Note

The length of these strings is 4 including the whitespace at the end

Expected output can be quoted or unquoted

.. code-block:: python

    >>> n = [
    ...     "zero",
    ...     "one",
    ...     "two",
    ... ]
    >>> for c, i in enumerate(n):
    ...     print(c, i)
    0 zero
    1 one
    2 two

Styles can be configured in a pyproject.toml file

[tool.readmetester]
style = "monokai"