Registry / testing / pytest-md-report

pytest-md-report

JSON →
library0.8.0pypypi✓ verified 85d ago

pytest-md-report is a pytest plugin designed to generate test outcomes reports formatted as markdown tables. It extends pytest's functionality by providing various command-line options and a programmatic interface to produce detailed, customizable reports. The library is actively maintained, with frequent updates to support new Python and pytest versions, currently at version 0.7.0.

pip install pytest-md-report
INSTALL
IMPORT
SIG · PYTEST-MD-REPORT
P
pytest-md-report
testingpythonv0.8.0
Install
4.7s avg
Import
Disk
56MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.8.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 53MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 4.7s · import 0.000s · 53MB
56MB installed
● package 56MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

make_md_report
from pytest_md_report import make_md_report
pytest --md-report --md-report-output=report.md
ColorPolicy
from pytest_md_report import ColorPolicy
plugin
from pytest_md_report import plugin

This quickstart demonstrates how to use pytest-md-report via the command line to generate a Markdown report. It creates a dummy test file, runs pytest with the `--md-report` flag to enable reporting, `--md-report-output` to specify an output file, and `--md-report-tee` to show the report on the console as well. The generated Markdown report will be saved as `report.md`.

import pytest import os def test_example_success(): assert True def test_example_failure(): assert False def test_example_skipped(): pytest.skip("demonstrating skip") # Create a dummy test file with open("test_example.py", "w") as f: f.write(""" import pytest def test_pass(): assert 1 + 1 == 2 def test_fail(): assert 1 + 1 == 3 @pytest.mark.skip(reason='demonstrating skip') def test_skip(): assert True """ ) # Run pytest with md-report options # This will generate 'report.md' in the current directory # and also output to stdout due to --md-report-tee # Using os.system for demonstration; in a real script, prefer pytest.main() # For security, avoid os.system with untrusted input. print("\n--- Running tests and generating report ---") os.system("pytest --md-report --md-report-output=report.md --md-report-tee test_example.py") print("\n--- Report generated: report.md ---") print(open("report.md").read()) # Clean up os.remove("test_example.py") os.remove("report.md")
Debug
Known issues
breakingSupport for Python 3.7 and 3.8 was dropped in version 0.6.3. Users on these Python versions must either upgrade Python or pin pytest-md-report to a version prior to 0.6.3.
fix
Upgrade Python to 3.9 or newer, or downgrade `pytest-md-report` to `<0.6.3`.
affects: >=0.6.3
breakingThe maximum supported `pytest` version was bumped to `<9` in version 0.5.1. Users with `pytest` version 9.0.0 or higher may experience compatibility issues or unexpected behavior.
fix
Ensure your `pytest` installation is less than version 9 (e.g., `pytest<9`). Check the `pytest-md-report` changelog for updates on pytest 9+ support.
affects: >=0.5.1
gotchaWhen using the `--md-report-flavor=gfm` option on Windows, backslashes in paths (`\`) could be misinterpreted by GitHub Flavored Markdown in versions prior to 0.6.2, leading to incorrectly rendered reports.
fix
Upgrade to `pytest-md-report>=0.6.2` to ensure stable results with GFM on Windows, or avoid the `gfm` flavor on Windows.
affects: <0.6.2
deprecatedThe `make_md_report` programmatic method no longer requires the `exclude_outcomes` parameter when called, starting from version 0.6.1. While still accepted, passing this argument might be considered redundant in future versions.
fix
Remove the `exclude_outcomes` parameter when calling `make_md_report` if its default behavior is desired. If specific outcomes need to be excluded, use the new `md_report_exclude_outcomes` option or equivalent.
affects: >=0.6.1
gotchaTo display test parameters in the report, the verbosity level must be set to `2` using `--md-report-verbose=2`. Previous versions (before 0.7.0) did not support this granular level of detail for parameters.
fix
Upgrade to `pytest-md-report>=0.7.0` and use the `--md-report-verbose=2` option to show test parameters.
affects: <0.7.0
Upgrade
Version history
0.8.0latest on PyPI · released May 4, 2026
Audit
Dependencies
pytestrequiredCore testing framework that this plugin extends.
pytablewriterrequiredUsed internally for generating markdown tables. Minimum version bumps have occurred across releases.
PythonrequiredRequires Python 3.9 or newer.
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources