Skip to main content

pytest-pretty

CI pypi versions license

Opinionated pytest plugin to make output slightly easier to read and errors easy to find and fix.

pytest-pretty's only dependencies are rich and pytest itself.

Realtime error summary

One-line info on which test has failed while tests are running:

Realtime Error Summary

Table of failures

A rich table of failures with both test line number and error line number:

Table of Failures

This is extremely useful for navigating to failed tests without having to scroll through the entire test output.

Prettier Summary of a Test Run

Including time taken for the test run:

Test Run Summary

Installation

pip install -U pytest-pretty

Usage with GitHub Actions

If you're using pytest-pretty (or indeed, just pytest) with GitHub Actions, it's worth adding the following to the top of your workflow .yml file:

env:
  COLUMNS: 120

This will mean the pytest output is wider and easier to use, more importantly, it'll make the error summary table printed by pytest-pretty much easier to read, see this discussion for more details.

pytester_pretty fixture

The pytest_pretty provides pytester_pretty fixture that work with modified version of output. It is designed to drop in places replacement of pytester fixture and uses it internally.

So to use them it is required to set pytest_plugins = "pytester" as mentioned in pytest documentation https://docs.pytest.org/en/latest/reference/reference.html#pytester

Release files for pytest-pretty 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-pretty 1.3.0
File Size Uploaded
pytest_pretty-1.3.0.tar.gz 219.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-pretty 1.3.0
File Interpreter ABI Platform
pytest_pretty-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 224.9 kB

Release files / pytest_pretty-1.3.0.tar.gz

Download URL pytest_pretty-1.3.0.tar.gz
Size 219.3 kB
Tags Source
SHA-256 checksum
How to use checksums
97e9921be40f003e40ae78db078d4a0c1ea42bf73418097b5077970c2cc43bf3
BLAKE2b-256 checksum
How to use checksums
bad7c699e0be5401fe9ccad484562f0af9350b4e48c05acf39fb3dab1932128f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.10

Release files / pytest_pretty-1.3.0-py3-none-any.whl

Download URL pytest_pretty-1.3.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
074b9d5783cef9571494543de07e768a4dda92a3e85118d6c7458c67297159b7
BLAKE2b-256 checksum
How to use checksums
ab852f97a1b65178b0f11c9c77c35417a4cc5b99a80db90dad4734a129844ea5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.10

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page