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.2.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.2.0
File Size Uploaded Provenance Actions
irondocs-0.2.0.tar.gz 8.8 kB Without provenance Details for irondocs-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 21.6 kB

Release files / irondocs-0.2.0.tar.gz

Download URL irondocs-0.2.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2be6be343a80d558760e5b1939ef97594537042fab496666520ffe8c6283b215
BLAKE2b-256 checksum
How to use checksums
3ed8764dff7e6a4a2d974ed529d561b0b9cab342044a8e2533a1d2a2180bf6d7
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.2.0-py3-none-any.whl

Download URL irondocs-0.2.0-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e941d2c93afe064f5b0d8f58f9d29515fb6ea41da196a5a643ffb28438542fe7
BLAKE2b-256 checksum
How to use checksums
361f7db7e11b7287943aea516d29ced811f3ace9bc07318c7ab93d75e9952a5b
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.2.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