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 tokenchat- slack chat idon_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94f4bdadbf1710cc1f6809086662d535183ea53c373810d023f52bfd14117fe0
|
|
| MD5 |
2451bc4dde85be3992f377879f8002ca
|
|
| BLAKE2b-256 |
c04c0da0189b980847af4e4a527578434aba141a0ca4900aec02f9757cfd47b9
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efed8964f8c5a6163f9a1e024003392aefeae806257b3b70ddbe24255875e5a9
|
|
| MD5 |
316c77e95e07ee72e38505cd2efd56ec
|
|
| BLAKE2b-256 |
4047e6f2f1666e3d70fd677b1a6ec292b40ef54de45cdf14a65aed697127818e
|