Parse, test, and assert RST code-blocks
Project description
Parse and test README.rst Python 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 "... "
Expected output can be quoted or unquoted
.. code-block:: python
>>> print("Hello, world!")
'Hello, world!'
.. 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"
Using readmetester API
>>> import readmetester
>>> readmetester.main()
"recursive exec not implemented"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
readmetester-2.3.0.tar.gz
(10.9 kB
view hashes)
Built Distribution
Close
Hashes for readmetester-2.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eea55f19ae4ded34c0250f69eae9f569d284f5cb950922dbf3e0dc25b46ee041 |
|
MD5 | 46f1ec0d9bd0e9eb2f4aa6a018c6c1ab |
|
BLAKE2b-256 | f6dce9dc9209a64184bb8a5a4e4120f878f5302a9968b5d4bda87284f5acae8b |