Skip to main content

Parse, test, and assert RST code-blocks

Project description

build python3.8 pypi codecov.io readthedocs.org mit black

Parse and test README.rst Python code-blocks

Installation

$ pip install readmetester

Code blocks need to begin with

.. code-block:: python

followed by a blank line

and end with

..

Usage

readmetester [-h] file

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

Documented code needs to be indented

Python code begins with ">>> "

Expected output can be single quoted or unquoted (no double quotes)

.. code-block:: python

    >>> print("Hello, world!")
    'Hello, world!'
..

Continuation lines begin with "... "

.. code-block:: python

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

readmetester-1.0.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

readmetester-1.0.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file readmetester-1.0.1.tar.gz.

File metadata

  • Download URL: readmetester-1.0.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.1 requests/2.26.0 setuptools/57.1.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11+

File hashes

Hashes for readmetester-1.0.1.tar.gz
Algorithm Hash digest
SHA256 10a0f043571f0c206ba45836ac3171696620911a1cc5bd2a996d988daad4c0e9
MD5 9e4282fb814c02fa42abe9bc154d4cbb
BLAKE2b-256 7aa3df111f864c97421666abb85ec2ca10db4107744ad42ccefef1847cd4ebd3

See more details on using hashes here.

File details

Details for the file readmetester-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: readmetester-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.1 requests/2.26.0 setuptools/57.1.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11+

File hashes

Hashes for readmetester-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7971628d224bfecb1766e5e20a6f69a8a044ff1b5a3d7f11ee9481904d400296
MD5 0660eacb657c10bc902ca25904a95f45
BLAKE2b-256 dbbec0f5ced304c36c510c01004b88b52ef6fe951864106c4f69ca6b3c890886

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page