pytest-markdown-summary
A pytest plugin that generates a Markdown summary table of your test results. Useful for CI pipelines, pull request comments, and automated reporting.
Features
- Generates a clean Markdown table with per-test or per-file result breakdown
- Tracks all outcome types: passed, failed, errored, skipped, xfail, and xpass
- Groups parametrized test variants into a single row
- Includes a TOTAL summary row with aggregated counts
- Automatically creates output directories if they don't exist
- Zero configuration needed beyond specifying the output file path
Installation
pip install pytest-markdown-summary
The plugin supports:
- Python:
>=3.11 - pytest:
>=7,<10
Usage
The plugin is activated by providing the --markdown-summary-file option to pytest:
pytest --markdown-summary-file=report.md
Command-Line Options
| Option | Description |
|---|---|
--markdown-summary-file PATH |
Path to the output Markdown report file. Report generation is disabled if not provided. |
--markdown-summary-use-test-names |
Track results per individual test function. When disabled (default), results are grouped per test file. |
Per-File Grouping (Default)
By default, test results are grouped by file:
pytest --markdown-summary-file=report.md
Per-Test Grouping
To track each test function individually:
pytest --markdown-summary-file=report.md --markdown-summary-use-test-names
Output Example
Per-File Mode (Default)
pytest --markdown-summary-file=report.md
| Test File | Passed | Failed | Errored | Skipped | Unexpectedly Passed | Expectedly Failed | Subtotal |
|---|---|---|---|---|---|---|---|
| tests/test_auth.py | 5 | 1 | 6 | ||||
| tests/test_api.py | 8 | 2 | 1 | 11 | |||
| TOTAL | 13 | 2 | 1 | 1 | 17 |
Per-Test Mode
pytest --markdown-summary-file=report.md --markdown-summary-use-test-names
| Test File | Test Name | Passed | Failed | Errored | Skipped | Unexpectedly Passed | Expectedly Failed | Subtotal |
|---|---|---|---|---|---|---|---|---|
| tests/test_auth.py | test_login | 3 | 3 | |||||
| tests/test_auth.py | test_logout | 1 | 1 | |||||
| tests/test_api.py | test_get_users | 1 | 1 | |||||
| tests/test_api.py | test_create_user | 1 | 1 | |||||
| TOTAL | 5 | 1 | 6 |
Note: Parametrized tests (e.g.,
@pytest.mark.parametrize) are automatically grouped into a single row under the base test name.
CI Integration
GitHub Actions
Use the generated Markdown file in GitHub Actions job summaries:
- name: Run tests
run: pytest --markdown-summary-file=report.md
- name: Add summary to job
if: always()
run: cat report.md >> $GITHUB_STEP_SUMMARY
As a PR Comment
You can also post the report as a pull request comment using actions like marocchino/sticky-pull-request-comment:
- name: Run tests
run: pytest --markdown-summary-file=report.md
- name: Comment on PR
if: always() && github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v2
with:
path: report.md
Contribution
Contributions are always welcome! If you have an idea, it's best to float it by me before working on it to ensure no effort is wasted. If there's already an open issue for it, knock yourself out.
License
Licensed under MIT license.Release files for pytest-markdown-summary 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_markdown_summary-0.1.0.tar.gz | 12.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_markdown_summary-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:19.0 kB
Release files / pytest_markdown_summary-0.1.0.tar.gz
| Download URL | pytest_markdown_summary-0.1.0.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9be6da61170f0e184bf8f858a61eafe4a33ffac5b368ffd6ed19bc491a36ceb3
|
|
BLAKE2b-256 checksum How to use checksums |
14953972c26206045fc68bfa51b331c453ed12dc4bbf7f09b506334fb4b85e80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 30, 2026.
Transparency logRelease files / pytest_markdown_summary-0.1.0-py3-none-any.whl
| Download URL | pytest_markdown_summary-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c33a2ef1dd7b4a6ba9fd4257e10522b98f454053cb973d3b9e7d9ac8c7a59e7
|
|
BLAKE2b-256 checksum How to use checksums |
3c41f72be7f982dd3816593ce2f5dd19507d4deab482b13f9a3dd81280dffe61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 30, 2026.
Transparency log