kianmeng / pytest-pretty

pytest plugin for pretty printing the test summary.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pytest-pretty

CI pypi versions license

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

This plugin is inspired by pytest-sugar

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

Usage with GitHub Actions

If you're using pytest-pretty (or inded, 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.

About

pytest plugin for pretty printing the test summary.

License:MIT License


Languages

Language:Python 79.9%Language:Makefile 20.1%