Skip to main content

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 | 0 skipped

## Failures

### test_validation.py::test_invalid_input[empty] ✗

**Error**: AssertionError

```python
>       assert validate(input) == expected
E       AssertionError: assert True == False

test_validation.py:42: AssertionError
```

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 | 0 skipped

Re-run failed: `just test --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 in test name [empty]

Skipped tests: symbol with skip reason, no traceback

xfail: symbol distinguishes expected failures

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

pytest_markdown_report-0.0.1.tar.gz (40.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_markdown_report-0.0.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file pytest_markdown_report-0.0.1.tar.gz.

File metadata

  • Download URL: pytest_markdown_report-0.0.1.tar.gz
  • Upload date:
  • Size: 40.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.1

File hashes

Hashes for pytest_markdown_report-0.0.1.tar.gz
Algorithm Hash digest
SHA256 190ec8bdca0617eb2e4015b27bcd4afd83be34d28b5f0477ef1f8fc18a591e1a
MD5 cbfd3886779e699b05447f1570abd49c
BLAKE2b-256 ca55bfa05e71b9490970cfdb9bd5daf1cb42c3a95ca1df04c848eddadf17d40a

See more details on using hashes here.

File details

Details for the file pytest_markdown_report-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_markdown_report-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 052c93c862b403c774430d41dd709c59e57e6aee28086b1ebad41ee9eaeeb60f
MD5 0fddc9902bd60722bf4be085450b35eb
BLAKE2b-256 fb8b8d4a9d72288b43b9294d0424941f19c14d2c60daef22007a1f663c9d7ff2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page