Metadata-Version: 2.1
Name: pytest-pretty
Version: 1.2.0
Summary: pytest plugin for printing summary data as I want it
Project-URL: repository, https://github.com/samuelcolvin/pytest-pretty
Author-email: Samuel Colvin <s@muelcolvin.com>
License: The MIT License (MIT)
        
        Copyright (c) 2022 to present Samuel Colvin
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Environment :: MacOS X
Classifier: Framework :: Hypothesis
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Requires-Dist: pytest>=7
Requires-Dist: rich>=12
Description-Content-Type: text/markdown

# pytest-pretty

[![CI](https://github.com/samuelcolvin/pytest-pretty/workflows/CI/badge.svg?event=push)](https://github.com/samuelcolvin/pytest-pretty/actions?query=event%3Apush+branch%3Amain+workflow%3ACI)
[![pypi](https://img.shields.io/pypi/v/pytest-pretty.svg)](https://pypi.python.org/pypi/pytest-pretty)
[![versions](https://img.shields.io/pypi/pyversions/pytest-pretty.svg)](https://github.com/samuelcolvin/pytest-pretty)
[![license](https://img.shields.io/github/license/samuelcolvin/pytest-pretty.svg)](https://github.com/samuelcolvin/pytest-pretty/blob/main/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](https://pypi.org/project/rich/) and pytest itself.

### Realtime error summary

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

![Realtime Error Summary](./screenshots/realtime-error-summary.png)

### Table of failures

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

![Table of Failures](./screenshots/table-of-failures.png)

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](./screenshots/test-run-summary.png)

## 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:

```yaml
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](https://github.com/Textualize/rich/issues/2769) 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
