pytest-chic-report
is a plugin for pytest that allows you to generate test result summaries in Markdown format and send them to Slack or Teams channels.
You can install pytest-chic-report
via pip from PyPI.
pip install pytest-chic-report
Adding Command Line Options
The plugin adds several command line options to customize the reports:
--summary
Print a summary in the terminal (enabled by default).--suite-name
Specify the name of the test suite (default: "Regression").--whois
Specify the name of the user who triggered the tests.--verify-ssl
Enable TLS certificate verification.--slack-webhook
Specify the webhook URL for Slack to send the report.--teams-webhook
Specify the webhook URL for Teams to send the report.--include-failed
Include a template of failed tests in the message.--include-errors
Include a template of error tests in the message.--include-all-tests
Include a template of all tests in the message.
pytest --slack-webhook https://hooks.slack.com/services/XXXXX/XXXXX/XXXXX
The report is generated in Markdown format and sent to the specified channel, featuring color-coded test results:
- green ✅ - all tests passed
- red ❌ - at least one test failed or error
- yellow ⏸️ - all tests skipped
Example Report
--------- Suite Summary ---------
Suite name: Regression
Passed amount: 7
Failed amount: 1
Skipped amount: 1
Xfailed amount: 4
Xpassed amount: 2
Total tests: 15
Total duration: 0.02 seconds
Successful tests: 47 %
From: Linux-6.8.0-47-generic-x86_64-with-glibc2.39
Show less
Sent by Anonymous | Today at 10:32 AM
Note: This does not work with the pytest-xdist plugin.