Skip to main content

Configure the symbols displayed for test outcomes

Project description

travis pypi pyversions


A plugin for defining your own characters to be used when displaying test outcomes in pytest (passed, failed, skipped etc).

For example, if you wanted to see a PILE OF POO (U+1F4A9) glyph displayed in the terminal report for each failing test:

pytest --report-failed=💩

To persist your custom characters, add a section like this in the configuration file (i.e. in pytest.ini, tox.ini, setup.cfg or whatever):

report_failed = 💩
report_failed_verbose = OH CRAP

Installation and Usage

pip install pytest-custom-report

This will add new command-line arguments and configuration file options to pytest (detailed in the following section). Command line arguments take precedence over configuration file settings. The plugin is always enabled, but unless you’ve configured your own symbols the pytest defaults are used.

To execute tests with the plugin disabled temporarily, use this:

pytest -p no:pytest-custom-report

If you’re trying to use emojis but you can’t see the glyphs properly in your terminal, you may be missing unicode fonts with the upper plane - you could install for example GNU Unifont.


The table below shows the available options as well as pytest’s default style for each outcome.

test outcome command-line argument name .ini file config key default report symbol
passed --report-passed report_passed .
xpassed --report-xpassed report_xpassed X
failed --report-failed report_failed F
xfailed --report-xfailed report_xfailed x
skipped --report-skipped report_skipped s
error --report-error report_error E

When tests are executed with -v or --verbose flag enabled, you’ll see longer strings displayed and one-line per test outcome. These can be specified too.

test outcome command-line argument name .ini file config key default report string
passed --report-passed-verbose report_passed_verbose PASSED
xpassed --report-xpassed-verbose report_xpassed_verbose XPASS
failed --report-failed-verbose report_failed_verbose FAILED
xfailed --report-xfailed-verbose report_xfailed_verbose xfail
skipped --report-skipped-verbose report_skipped_verbose SKIPPED
error --report-error-verbose report_error_verbose ERROR

Example config file

Here is some example pytest.ini content that you can copy-paste and modify to your liking:


report_passed = ✔
report_xpassed = 🦄
report_failed = ✗
report_xfailed = 👎
report_skipped = ?
report_error = 🔥

report_passed_verbose = OH YEAH
report_xpassed_verbose = WHAT IN TARNATION?
report_failed_verbose = OH CRAP
report_xfailed_verbose = YEAH WHATEVER
report_skipped_verbose = DON'T CARE
report_error_verbose = YOU MEDDLING KIDS!

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pytest_custom_report-1.0.0-py2.py3-none-any.whl (4.3 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Aug 21, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page