pytest plugin for printing summary data as I want it
Project description
pytest-pretty
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:
Table of failures
A rich table of failures with both test line number and error line number:
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:
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 internaly.
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
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
File details
Details for the file pytest_pretty-1.2.0.tar.gz
.
File metadata
- Download URL: pytest_pretty-1.2.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 105a355f128e392860ad2c478ae173ff96d2f03044692f9818ff3d49205d3a60 |
|
MD5 | 476f4f239e9d8e5d5295bc3cd07f20b1 |
|
BLAKE2b-256 | a51830ad0408295f3157f7a4913f0eaa51a0a377ebad0ffa51ff239e833c6c72 |
File details
Details for the file pytest_pretty-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: pytest_pretty-1.2.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f79122bf53864ae2951b6c9e94d7a06a87ef753476acd4588aeac018f062036 |
|
MD5 | e571a61653a73a091f54a636db2c6754 |
|
BLAKE2b-256 | bffed44d391312c1b8abee2af58ee70fabb1c00b6577ac4e0bdf25b70c1caffb |