Skip to main content

Pytest plugin for sending report message of marked tests execution

Project description

Pytest-Message

Pytest-message is a pytest extension for reporting to various messangers.

Pytest-message gives an ability to send report message of test status for only marked tests.

Installation

pip install pytest-message

Example

Currently pytest-message integrates with slack only(other popular messengers integration in progress)

In order to receive messages you need to define listener and pass list of listeners to notify decorator

from pytest_message.listeners import SlackListener
from pytest_message import notify


slack_listener = SlackListener(token="slack_secret_token", chat='chat_id')


@notify([slack_listener])
def test_sum():
    assert 1 + 1 == 2

You may pass as much listeners as you want to get report messages to all listeners.

SlackListener

SlackListener constructor takes required: token, chat and optional: on_error_add fields.

  • token - slack token
  • chat - slack chat id
  • on_error_add[Optional] - takes string which will be added after failed or skipped test function name in main thread. Is nice for tagging responsible person if required or add any custom comment.

Launch

In order to start tests with Pytest-Message you must provide --notify flag:

pytest tests --notify

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-message-1.0.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

pytest_message-1.0.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file pytest-message-1.0.0.tar.gz.

File metadata

  • Download URL: pytest-message-1.0.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pytest-message-1.0.0.tar.gz
Algorithm Hash digest
SHA256 94f4bdadbf1710cc1f6809086662d535183ea53c373810d023f52bfd14117fe0
MD5 2451bc4dde85be3992f377879f8002ca
BLAKE2b-256 c04c0da0189b980847af4e4a527578434aba141a0ca4900aec02f9757cfd47b9

See more details on using hashes here.

File details

Details for the file pytest_message-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_message-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pytest_message-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 efed8964f8c5a6163f9a1e024003392aefeae806257b3b70ddbe24255875e5a9
MD5 316c77e95e07ee72e38505cd2efd56ec
BLAKE2b-256 4047e6f2f1666e3d70fd677b1a6ec292b40ef54de45cdf14a65aed697127818e

See more details on using hashes here.

Supported by

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