Skip to main content

Pytest to Slack reporting plugin

Project description

pytest-slack

https://img.shields.io/pypi/v/pytest-slack.svg https://img.shields.io/travis/pytest-dev/pytest-slack.svg https://codecov.io/gh/pytest-dev/pytest-slack/branch/master/graph/badge.svg Documentation Status Updates

Pytest to Slack reporting plugin

Requirements

  • Python3 version [3.5+]

  • Requests

  • Make sure you have the latest version of pytest installed for your environment

Installation

You can install “pytest-slack” via pip:

$ pip install pytest-slack

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
  --slack_success_icon=SLACK_SUCCESS_ICON [default = :thumbsup:]
                        Set icon for a successful run
  --slack_failed_icon=SLACK_FAILED_ICON [default = :thumbsdown:]
                        Set icon for a failed run

Example

$ pytest tests –slack_hook=https://hooks.slack.com/services/… –slack_channel=test_report_channel –slack_username=”Regression testing results”

All kind of problems:

https://raw.githubusercontent.com/pytest-dev/pytest-slack/master/img/failed.png

Passed test:

https://raw.githubusercontent.com/pytest-dev/pytest-slack/master/img/success.png

$ 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:

https://raw.githubusercontent.com/pytest-dev/pytest-slack/master/img/success_link.png

Issues

If you encounter any problems, please file an issue along with a detailed description.

History

1.0.1 (2019-04-18)

  • First release on PyPI.

Project details


Download files

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

Source Distribution

pytest-slack-1.0.3.tar.gz (10.1 kB view hashes)

Uploaded Source

Built Distribution

pytest_slack-1.0.3-py2.py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page