Skip to main content

Irondocs

Run Python code blocks from your markdown docs as real pytest tests. Mark a fenced block with test, and it becomes a runnable assertion — no separate test file, no boilerplate, no drift between docs and code. Python 3.12+.

Install

pip install irondocs
# or
uv add --dev irondocs

Irondocs is a pytest plugin: installing it is enough to load it.

Write a doctest

Add test to any python fence in any .md file. The block runs as one test named after the nearest preceding heading. Failures read like any pytest failure, pointing at the line of the .md file.

```python test
from statistics import mean

assert mean([1, 2, 3]) == 2
```

Untagged python blocks render normally and are not run, so you can mix illustrative snippets and runnable assertions in the same article.

Wire it into pytest

List the markdown files to collect under irondocs_files, and make sure pytest walks the folder that holds them:

[tool.pytest.ini_options]
testpaths = ["tests", "docs"]
irondocs_files = ["docs/*.md"]

Run your usual pytest — your .md files now run alongside your test_*.py files. See Writing tests for the marker syntax, Running tests for what to expect at the terminal, and Configuration for the options.

Metadata

Release files for irondocs 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for irondocs 0.3.0
File Size Uploaded Provenance Actions
irondocs-0.3.0.tar.gz 9.3 kB Without provenance Details for irondocs-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for irondocs 0.3.0
File Interpreter ABI Platform Actions
irondocs-0.3.0-py3-none-any.whl Python 3 none any Details for irondocs-0.3.0-py3-none-any.whl

Total release size: 22.5 kB

Release files / irondocs-0.3.0.tar.gz

Download URL irondocs-0.3.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2ef8fc9cf4a4c79687b5df76ea16592ffa8957d220875b70711fcd88649f0cb8
BLAKE2b-256 checksum
How to use checksums
22b9a80e00940e550d5c4996383296209d7038a47f508c6159b143523d6117b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / irondocs-0.3.0-py3-none-any.whl

Download URL irondocs-0.3.0-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea57e6a30e532d9d7a957b50cb2915dd762c547340cabd82135c4b11b153e5dc
BLAKE2b-256 checksum
How to use checksums
0795c0c27c33c1937f278db1ab7145b6cd4e8f1aab780225f95def7710842505
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for irondocs 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page