Token-efficient markdown test reports for LLM-based TDD agents
Project description
pytest-markdown-report
Token-efficient markdown test reports for LLM-based TDD agents. Replaces pytest's default console output with markdown-formatted results.
Installation
Add to the development dependencies of your project.
pip install pytest-markdown-report
uv add --dev pytest-markdown-report
poetry add --group dev pytest
Usage
Once installed, the plugin automatically replaces pytest's console output with markdown format:
# Markdown output to console (default behavior)
pytest
# Also save to file
pytest --markdown-report=report.md
Verbosity Modes
Default: Summary + failures
pytest
Verbose (-v): Add passed test list
pytest -v
Quiet (-q): Summary + rerun suggestion only
pytest -q
Options
Save to file:
pytest --markdown-report=report.md
Custom rerun command:
pytest --markdown-rerun-cmd="just test --lf"
Disable rerun suggestion:
pytest --markdown-rerun-cmd=""
Output Format
Default Mode
# Test Report
**Summary:** 2/5 passed, 3 failed
## Failures
### test_validation.py::test_invalid_input[empty] FAILED
```python
test_validation.py:42: in test_invalid_input
assert validate(input) == expected
E AssertionError: assert False == True
```
### test_database.py::test_with_db FAILED in setup
```python
conftest.py:15: in db_connection
raise ConnectionError("Database unavailable")
E ConnectionError: Database unavailable
```
Note: Setup and teardown failures show phase notation (e.g., FAILED in setup) to distinguish fixture issues from test assertion failures.
Verbose Mode (-v)
Adds passed test list after failures:
## Passes
- test_feature.py::test_critical_path
- test_basic.py::test_simple
Quiet Mode (-q)
**Summary:** 2/5 passed, 3 failed
**Re-run failed:** `pytest --lf`
Design Goals
- Token efficiency: ~40% reduction vs verbose markdown
- Agent-friendly: Full tracebacks with assertion introspection
- TDD workflow: Minimal noise during green phase, detailed failures for debugging
- Configurable: Adapt rerun commands to your workflow (
just, custom recipes)
Edge Cases
Parametrized tests: Parameter values shown in test name [empty]
Skipped tests: Labeled SKIPPED with skip reason in separate section
Expected failures: XFAIL label for expected failures, XPASS for unexpected passes
Setup/teardown failures: Phase notation shows context (e.g., FAILED in setup, FAILED in teardown)
Captured output: Included under failures when present
Integration
The plugin automatically formats all pytest output as markdown. Use with role-specific agents:
# Implementation agent sees failures only (console)
pytest
# Review agent sees all passes (console + file)
pytest -v --markdown-report=review.md --markdown-rerun-cmd="just role-review"
# Minimal output for CI/CD pipelines
pytest -q
Note: Use pytest --durations=N separately for performance analysis (this will also
be in markdown format).
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_markdown_report-0.1.1.tar.gz.
File metadata
- Download URL: pytest_markdown_report-0.1.1.tar.gz
- Upload date:
- Size: 71.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a142fc64ac36a149a818390b7deb78e7bc00553afcdb3a2bebfe744f8c34fe00
|
|
| MD5 |
869413d0898e412d55e53ce7478632c1
|
|
| BLAKE2b-256 |
40b96f1270fdb2c294a7a906ea87b184daebfbafe47f778753d8238f2aed4574
|
File details
Details for the file pytest_markdown_report-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pytest_markdown_report-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cac7aaca4c8d776db76cc066c825b4480574959dc94f3b16fc03efe17e736f0
|
|
| MD5 |
27ef776a5bcb5d3890107e199a3c929a
|
|
| BLAKE2b-256 |
4ec75c5c1172e09e9968278da75a79d9460bc3392efbdbc0865431a4a215c3c3
|