Skip to main content

Pytest plugin providing a Rich based reporter.

Project description

resources/demo1.png resources/demo2.png

Pytest-richer

A replacement progress and reporting front end for pytest, using Rich to provide enhanced output.

Status

The most recent release is 0.1.1.

This is alpha software. Probably quite robust alpha software (I use it all the time), but there will be pytest options that cause it to fail or behave weirdly.

Please try it and raise issues if you have problems. I intend to check daily and fix things quickly.

Getting started

  • Install from PyPi using pip, for example:

    python -m pip install --user pytest-richer
  • Clone this repository and install using pip, For example:

    python -m pip install --user pytest-richer

Using

Use the --rich command option when you invoke pytest.

See --help for additional rich- options.

Features

  • Detailed per-file/per directory progress display.

    • Per-file view is used for preference.

    • Per directory view is used when the number of files becomes unwieldy.

  • Works very well with pytest-xdist

    • When pytest-xdist is enabled, the progress display stays the same, rather than switching to a simplified form.

    • Collection errors cause run to stop instead of being ignored.

    • Error reporting formatting is unaffected by pytest-xdist.

    • Order of error reports are not affected by pytest-xdist.

  • Rich is used to format the details of collection and test execution errors.

    • Arguably more human parseable error reports (at least I think so; suggestions for improvements welcome).

    • In particular, collection error reports are easier to read.

  • Additional information displayed.

    • pytest-xdist output displayed as part of progress display.

    • Slow setup and teardown phases are visible on the progress display.

    • Setup and teardown errors separately identified on the progress display and in the final summary.

    • Number of active pytest-xdist workers (parallel test count) shown.

Some other notable differences from the standard pytest reporter.

  • Collection error details are reported when the --no-summary option is used.

  • Tracebacks are not as compact when the --tb=short option is used. This may change in the future, but is currently not practicable.

  • Long tracebacks include context lines after the failure line. This may change in the future, but is currently not practicable.

  • Long tracebacks only show 3 lines of context before the failure line; pytest shows all preceding lines within the function.

There will undoubtedly be other differences and missing standard features at this stage. Please raise an issue for any problems.

Credits

This was inspired by pytest-rich.

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

pytest-richer-0.1.1.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

pytest_richer-0.1.1-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file pytest-richer-0.1.1.tar.gz.

File metadata

  • Download URL: pytest-richer-0.1.1.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0+

File hashes

Hashes for pytest-richer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 55e78cf8e5d72cd495c249ada8d547fa5bdc6a469014c1674f3af607b67685eb
MD5 dc0531f92da9c8aced99f97a2a53fc58
BLAKE2b-256 66d4a39a28bc5dc6e6502d2345c3d905638c8af21a2620b951832b4087bb2439

See more details on using hashes here.

File details

Details for the file pytest_richer-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pytest_richer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0+

File hashes

Hashes for pytest_richer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ecafeb15c1f5ab654984b715927acb570f03f5f248d75d9fd9228dbc9a15854
MD5 1d467c3b0091fec963d26bcbf06e3f0b
BLAKE2b-256 6f21f84c3eb77001e174af867e3d58bc2648c2012fd55f56f2dcf4e6a0b7b614

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page