Skip to main content

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

Release files for pytest-message 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-message 1.0.0
File Size Uploaded
pytest-message-1.0.0.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-message 1.0.0
File Interpreter ABI Platform
pytest_message-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.2 kB

Release files / pytest-message-1.0.0.tar.gz

Download URL pytest-message-1.0.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
94f4bdadbf1710cc1f6809086662d535183ea53c373810d023f52bfd14117fe0
BLAKE2b-256 checksum
How to use checksums
c04c0da0189b980847af4e4a527578434aba141a0ca4900aec02f9757cfd47b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / pytest_message-1.0.0-py3-none-any.whl

Download URL pytest_message-1.0.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efed8964f8c5a6163f9a1e024003392aefeae806257b3b70ddbe24255875e5a9
BLAKE2b-256 checksum
How to use checksums
4047e6f2f1666e3d70fd677b1a6ec292b40ef54de45cdf14a65aed697127818e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page