pytest-slack¶
Pytest to Slack reporting plugin
- Free software: MIT license
- Documentation: https://pytest-slack.readthedocs.io.
Requirements¶
- Python3 version [3.5+]
- Requests
- Make sure you have the latest version of pytest installed for your environment
Usage¶
- Setup slack hook
- Use this plugin by running pytest normally and use the follwoing options to customize report:
>>> slack:
--slack_channel=SLACK_CHANNEL
Set the channel name to report
--slack_hook=SLACK_HOOK
Used for reporting to slack
--slack_report_link=SLACK_REPORT_LINK
Set the report link
--slack_username=SLACK_USERNAME
Set the reporter name
--slack_timeout=SLACK_TIMEOUT [DEFAULT = 10s ]
Set the timeout for sending results in seconds
Example¶
$ pytest tests –slack_hook=https://hooks.slack.com/services/… –slack_channel=test_report_channel –slack_username=”Regression testing results”
All kind of problems:
Passed test:
$ pytest tests –slack_hook=https://hooks.slack.com/services/… –slack_channel=test_report_channel –slack_username=”Regression testing results” –slack_report_link=http://any_address
Passed test with link:
Issues¶
If you encounter any problems, please file an issue along with a detailed description.