A plugin providing an alternative, colourful diff output for failing assertions.
Project description
A plugin to improve the readability of pytest output.
Features
Enables an easier to parse and more understandable diff for your failing tests.
Can display unified diffs or split diffs, and chooses them depending on the context.
Adds helpful hints to the output for failing tests to help you track down common issues.
With pytest-clarity:
The same test, without pytest-clarity:
Requirements
Supports Python 2.7 and 3.4+
Installation
You can install “pytest-clarity” via pip from PyPI:
$ pip install pytest-clarity
Usage
Install the plugin as described above.
** The plugin will only be activated when the -vv option is supplied to pytest.**
You can choose which type of diff you want with --diff-type
(auto (default), split or unified):
pytest -vv --diff-type=split
You can disable hints using the --no-hints
flag:
pytest -vv --no-hints
You can configure the width of the output with the --diff-width
option:
pytest -vv --diff-width=60
Contributing
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
License
Distributed under the terms of the MIT license, “pytest-clarity” is free and open source software.
Issues
If you encounter any problems, please file an issue along with a detailed description.
This pytest plugin was generated with Cookiecutter along with @hackebrot’s cookiecutter-pytest-plugin template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pytest-clarity-0.3.0a0.tar.gz
.
File metadata
- Download URL: pytest-clarity-0.3.0a0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cc99e3d9b7969dfe17e5f6072d45a917c59d363b679686d3c958a1ded2e4dcf |
|
MD5 | 15965bd481c16c29ef78cc6269512992 |
|
BLAKE2b-256 | 8ed71b57d83e8b27a8d3364fbdb3efbac1370db99c27738c0312fb7596601d8c |