A plugin providing an alternative, colourful diff output for failing assertions.
A plugin to improve the readability of pytest output.
- 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.
The same test, without pytest-clarity:
Supports Python 2.7 and 3.4+
Install the plugin as described above, and it will be automatically enabled.
You can choose which type of diff you want with
--diff-type (auto (default), split or unified):
You can disable hints using the
You can configure the width of the output with the
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.
Distributed under the terms of the MIT license, “pytest-clarity” is free and open source software.