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.1.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.1.0
File Size Uploaded Provenance Actions
irondocs-0.1.0.tar.gz 8.9 kB Without provenance Details for irondocs-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 21.7 kB

Release files / irondocs-0.1.0.tar.gz

Download URL irondocs-0.1.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4cafee28f7658c22f094de2ae7d216243c3586377bf8f70f03b69ef51207275c
BLAKE2b-256 checksum
How to use checksums
3ecf314e03d4d60d8976683cf485359695de19a2a8719819450a5544b6ae343a
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.1.0-py3-none-any.whl

Download URL irondocs-0.1.0-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
280a1d8441703f0974cad4670964a987b36f102f429e0c9f85ecab600be764a4
BLAKE2b-256 checksum
How to use checksums
5e02baa43db5366312907454d0c6d0afe3c09699a92d0884039a5a9978dc0c64
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.1.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