-
Notifications
You must be signed in to change notification settings - Fork 15
Slack
Laser edited this page Dec 16, 2020
·
1 revision
- Setup slack hook
- Use this plugin by running pytest normally and use the following 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
--slack_success_emoji=SLACK_SUCCESS_EMOJI [default = :thumbsup:]
Set emoji for a successful run
--slack_failed_emoji=SLACK_FAILED_EMOJI [default = :thumbsdown:]
Set emoji for a failed run
--slack_success_icon=SLACK_SUCCESS_ICON [default = None]
Set icon (a url) for a successful run. Overrides SLACK_SUCCESS_EMOJI
--slack_failed_icon=SLACK_FAILED_ICON [default = None]
Set icon (a url) for a failed run. Overrides SLACK_FAILED_EMOJI
$ 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:

- Free software: MIT license
- Full documentation: https://pytest-messenger.readthedocs.io.