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.2.tar.gz (43.2 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.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_markdown_report-0.0.2.tar.gz
  • Upload date:
  • Size: 43.2 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

Hashes for pytest_markdown_report-0.0.2.tar.gz
Algorithm Hash digest
SHA256 270824dc0bec3934f9c54255c47f0838892071d9d67a0cc239064f411d6aa259
MD5 9ffc4e812eb8159efd440b3523ab4bf7
BLAKE2b-256 9ff4e5e7cd38afab90ad013b97b08ea3936bf3698512860c75763c135b5b0ce6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_markdown_report-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 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

Hashes for pytest_markdown_report-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4981e458d14094c4799c78f8930638840d0725e00ed3ba2fb9956b79f7d85aac
MD5 3e7815d6517e4a5e3ebf9e6cd200bc6c
BLAKE2b-256 603ac4b2f24c0f258cdb62235083f7895b3b785fc0736fe4de2334040b86b5db

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