Beautiful terminal and HTML output for pytest-describe.
Project description
pytest-describe-beautifully
Beautiful terminal and HTML output for pytest-describe.
Transforms pytest-describe's nested test hierarchy into formatted, readable output with real-time results, tree summaries, and self-contained HTML reports.
Installation
pip install pytest-describe-beautifully
Requires Python 3.11+ and pytest-describe 2.0+.
Quick Start
# Enable beautiful terminal output
pytest --describe-beautifully
# Short form
pytest --db
# Generate an HTML report alongside terminal output
pytest --db --describe-html report.html
The plugin only activates when --describe-beautifully (or --db) is passed. Without it, pytest behaves as normal.
Terminal Output
With --db, test results print in real time as they complete, followed by a tree summary at the end:
Calculator
add
✓ it adds two numbers (3ms)
✓ it handles negatives (1ms)
divide
✓ it divides evenly (2ms)
✗ it raises on zero (1ms)
Summary
┌ Calculator (3/4 passed, 7ms)
├─┬ add (2/2 passed, 4ms)
│ ├── ✓ it adds two numbers (3ms)
│ └── ✓ it handles negatives (1ms)
└─┬ divide (1/2 passed, 3ms)
├── ✓ it divides evenly (2ms)
└── ✗ it raises on zero (1ms)
Outcome Symbols
| Symbol | Meaning |
|---|---|
| ✓ | Passed |
| ✗ | Failed |
| ○ | Skipped |
| ⊘ | Expected failure (xfail) |
| ✗! | Unexpected pass (xpass) |
| ☠ | Error (setup/teardown) |
Slow Test Markers
Tests exceeding the slow threshold get a ⏱ marker:
# Default threshold is 0.5s
pytest --db --describe-slow 1.0
Expanded Mode
Show docstrings and fixtures inline:
pytest --db --describe-expand-all
Calculator
add
✓ it adds two numbers (3ms)
Verifies basic addition of positive integers
🔧 calculator, sample_data
Hide fixtures while keeping docstrings:
pytest --db --describe-expand-all --describe-no-fixtures
HTML Reports
Generate a self-contained HTML file with no external dependencies:
pytest --db --describe-html report.html
The report includes:
- Summary badges -- total tests, passed, failed, skipped, and duration
- Collapsible describe blocks -- click to expand/collapse, blocks with failures open automatically
- Interactive controls -- Expand All, Collapse All, and Show Failed Only
- Test details -- outcome, duration, docstrings, fixtures, and full failure tracebacks
- Dark theme with semantic color coding
All CLI Options
| Flag | Default | Description |
|---|---|---|
--describe-beautifully / --db |
off | Enable the plugin |
--describe-slow SECONDS |
0.5 | Slow test threshold |
--describe-expand-all |
off | Show docstrings and fixtures inline |
--describe-no-fixtures |
off | Hide fixtures in expanded mode |
--describe-html PATH |
-- | Generate an HTML report at PATH |
Name Formatting
The plugin humanizes pytest-describe's naming conventions:
describe_MyClassbecomes MyClass (CamelCase preserved)describe_my_featurebecomes my featureit_does_somethingbecomes it does somethingthey_are_equalbecomes they are equal
Development
# Install in development mode
pip install -e ".[dev]"
# Run tests (100% branch coverage enforced)
python -m pytest
# Lint and format
python -m ruff check src/ tests/
python -m ruff format src/ tests/
# Mutation testing
mutmut run
License
MIT
Project details
Release history Release notifications | RSS feed
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_describe_beautifully-0.1.0.tar.gz.
File metadata
- Download URL: pytest_describe_beautifully-0.1.0.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6e4ff38ab848bda6ab3bdd3ed610aed144530f51878ea8f9aaa5b08eddc3a8e
|
|
| MD5 |
d61407f4e932861039ce49a1390d3846
|
|
| BLAKE2b-256 |
cc6fb23e764ecf21d334b426d9e91e0dba827d7fb1db97c124d645fca928b498
|
Provenance
The following attestation bundles were made for pytest_describe_beautifully-0.1.0.tar.gz:
Publisher:
publish.yml on markng/pytest-describe-beautifully
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_describe_beautifully-0.1.0.tar.gz -
Subject digest:
f6e4ff38ab848bda6ab3bdd3ed610aed144530f51878ea8f9aaa5b08eddc3a8e - Sigstore transparency entry: 868835140
- Sigstore integration time:
-
Permalink:
markng/pytest-describe-beautifully@a10565c7f8d0581eafaa2302360f2bcc06a9c4f5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/markng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a10565c7f8d0581eafaa2302360f2bcc06a9c4f5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytest_describe_beautifully-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pytest_describe_beautifully-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca709cffd76315be0f11f524bf303d16f287fb3e2afc783075f9e1c0aa962a79
|
|
| MD5 |
cb453b8abb860a63a350b0a0e19cf47f
|
|
| BLAKE2b-256 |
a82c23949819517799c37940810295736fca9e5399359dc35e4d1bed1c5d68e4
|
Provenance
The following attestation bundles were made for pytest_describe_beautifully-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on markng/pytest-describe-beautifully
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_describe_beautifully-0.1.0-py3-none-any.whl -
Subject digest:
ca709cffd76315be0f11f524bf303d16f287fb3e2afc783075f9e1c0aa962a79 - Sigstore transparency entry: 868835148
- Sigstore integration time:
-
Permalink:
markng/pytest-describe-beautifully@a10565c7f8d0581eafaa2302360f2bcc06a9c4f5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/markng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a10565c7f8d0581eafaa2302360f2bcc06a9c4f5 -
Trigger Event:
push
-
Statement type: