pytest-alerts


Namepytest-alerts JSON
Version 1.3.0 PyPI version JSON
download
home_pageNone
SummaryA pytest plugin for sending test results to Slack and Telegram
upload_time2025-01-28 07:12:52
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licensepytest-alerts License Copyright (c) 2025 Nikola Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, and distribute the Software, subject to the following conditions: 1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 2. Commercial Use Restriction: The Software and any modifications thereof may not be sold, licensed, or otherwise distributed for a fee or commercial gain without explicit written permission from the copyright holder. This includes, but is not limited to: - Selling the Software as a standalone product - Including the Software as part of a commercial product - Offering the Software as a paid service - Reselling modified versions of the Software 3. Permitted Uses: - Personal use - Educational use - Non-commercial organization use - Internal use in commercial organizations (where the Software is used but not sold) - Contributing improvements back to the original project 4. Attribution Requirement: Any distribution of the Software or modified versions must maintain attribution to the original author and project. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For commercial licensing inquiries, please contact: nikolaoutwork@gmail.com
keywords alerts notifications pytest slack telegram
VCS
bugtrack_url
requirements pytest requests black pytest-cov build twine
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pytest-alerts

A pytest plugin that sends test results to Slack and Telegram with beautiful, customizable formatting.

[![PyPI version](https://badge.fury.io/py/pytest-alerts.svg)](https://badge.fury.io/py/pytest-alerts)
[![Python Versions](https://img.shields.io/pypi/pyversions/pytest-alerts.svg)](https://pypi.org/project/pytest-alerts/)

## Overview

pytest-alerts is a powerful pytest plugin that automatically sends your test results to Slack and Telegram. It provides:

- 📲 Real-time test notifications to Slack and Telegram
- 🎨 Modern, visually appealing message formatting
- 📊 Comprehensive test statistics with progress bars
- 🔍 Configurable error reporting and details
- ⚙️ Extensive customization options
- 🔄 Full compatibility with pytest-xdist

## Quick Start

### Installation

```bash
pip install pytest-alerts
```

### Basic Usage

1. Configure your messaging platform:

   **For Slack:**
   ```bash
   pytest --slack_webhook=YOUR_WEBHOOK_URL
   ```

   **For Telegram:**
   ```bash
   pytest --telegram_bot_token=BOT_TOKEN --telegram_chat_id=CHAT_ID
   ```

2. Run with both platforms:
   ```bash
   pytest --slack_webhook=URL --telegram_bot_token=TOKEN --telegram_chat_id=ID
   ```

## Configuration Options

### Common Options

| Option | Description | Default |
|--------|-------------|---------|
| `--show_details` | Include error details in notifications | False |
| `--hide_errors` | Hide error messages from notifications | False |

### Slack-specific Options

| Option | Description | Required |
|--------|-------------|----------|
| `--slack_webhook` | Slack webhook URL | Yes |
| `--slack_icon` | Bot icon emoji | No |

### Telegram-specific Options

| Option | Description | Required |
|--------|-------------|----------|
| `--telegram_bot_token` | Bot API token | Yes |
| `--telegram_chat_id` | Target chat ID | Yes |

## Message Formatting

### Default Format
Messages include:
- Test run summary (passed/failed/skipped)
- Progress bars for visual representation
- Duration of test run
- Error details (if enabled)
- Project/branch information (if available)

### Customization
- Use `--show_details` for full error traces
- Use `--hide_errors` to omit error messages
- Platform-specific formatting options available

## Advanced Usage

### CI/CD Integration
Example GitHub Actions workflow:
```yaml
steps:
  - uses: actions/checkout@v2
  - name: Run tests with notifications
    run: |
      pip install pytest-alerts
      pytest --slack_webhook=${{ secrets.SLACK_WEBHOOK }} --telegram_bot_token=${{ secrets.TELEGRAM_BOT_TOKEN }} --telegram_chat_id=${{ secrets.TELEGRAM_CHAT_ID }}
```

## Limitations

- Maximum message size varies by platform
- Rate limits apply (platform-specific)
- Some formatting options are platform-dependent

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Support

- 📖 [Documentation](https://github.com/nikolaout/pytest-alerts)
- 🐛 [Issue Tracker](https://github.com/nikolaout/pytest-alerts/issues)
- 💬 [Discussions](https://github.com/nikolaout/pytest-alerts/discussions)

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for version history and changes.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pytest-alerts",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "alerts, notifications, pytest, slack, telegram",
    "author": null,
    "author_email": "Nikola <nikolaoutwork@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/08/df/a9c1458a7e20521c5967f1a4b39eda1310068a061a40e599666e6f32f4da/pytest_alerts-1.3.0.tar.gz",
    "platform": null,
    "description": "# pytest-alerts\n\nA pytest plugin that sends test results to Slack and Telegram with beautiful, customizable formatting.\n\n[![PyPI version](https://badge.fury.io/py/pytest-alerts.svg)](https://badge.fury.io/py/pytest-alerts)\n[![Python Versions](https://img.shields.io/pypi/pyversions/pytest-alerts.svg)](https://pypi.org/project/pytest-alerts/)\n\n## Overview\n\npytest-alerts is a powerful pytest plugin that automatically sends your test results to Slack and Telegram. It provides:\n\n- \ud83d\udcf2 Real-time test notifications to Slack and Telegram\n- \ud83c\udfa8 Modern, visually appealing message formatting\n- \ud83d\udcca Comprehensive test statistics with progress bars\n- \ud83d\udd0d Configurable error reporting and details\n- \u2699\ufe0f Extensive customization options\n- \ud83d\udd04 Full compatibility with pytest-xdist\n\n## Quick Start\n\n### Installation\n\n```bash\npip install pytest-alerts\n```\n\n### Basic Usage\n\n1. Configure your messaging platform:\n\n   **For Slack:**\n   ```bash\n   pytest --slack_webhook=YOUR_WEBHOOK_URL\n   ```\n\n   **For Telegram:**\n   ```bash\n   pytest --telegram_bot_token=BOT_TOKEN --telegram_chat_id=CHAT_ID\n   ```\n\n2. Run with both platforms:\n   ```bash\n   pytest --slack_webhook=URL --telegram_bot_token=TOKEN --telegram_chat_id=ID\n   ```\n\n## Configuration Options\n\n### Common Options\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--show_details` | Include error details in notifications | False |\n| `--hide_errors` | Hide error messages from notifications | False |\n\n### Slack-specific Options\n\n| Option | Description | Required |\n|--------|-------------|----------|\n| `--slack_webhook` | Slack webhook URL | Yes |\n| `--slack_icon` | Bot icon emoji | No |\n\n### Telegram-specific Options\n\n| Option | Description | Required |\n|--------|-------------|----------|\n| `--telegram_bot_token` | Bot API token | Yes |\n| `--telegram_chat_id` | Target chat ID | Yes |\n\n## Message Formatting\n\n### Default Format\nMessages include:\n- Test run summary (passed/failed/skipped)\n- Progress bars for visual representation\n- Duration of test run\n- Error details (if enabled)\n- Project/branch information (if available)\n\n### Customization\n- Use `--show_details` for full error traces\n- Use `--hide_errors` to omit error messages\n- Platform-specific formatting options available\n\n## Advanced Usage\n\n### CI/CD Integration\nExample GitHub Actions workflow:\n```yaml\nsteps:\n  - uses: actions/checkout@v2\n  - name: Run tests with notifications\n    run: |\n      pip install pytest-alerts\n      pytest --slack_webhook=${{ secrets.SLACK_WEBHOOK }} --telegram_bot_token=${{ secrets.TELEGRAM_BOT_TOKEN }} --telegram_chat_id=${{ secrets.TELEGRAM_CHAT_ID }}\n```\n\n## Limitations\n\n- Maximum message size varies by platform\n- Rate limits apply (platform-specific)\n- Some formatting options are platform-dependent\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- \ud83d\udcd6 [Documentation](https://github.com/nikolaout/pytest-alerts)\n- \ud83d\udc1b [Issue Tracker](https://github.com/nikolaout/pytest-alerts/issues)\n- \ud83d\udcac [Discussions](https://github.com/nikolaout/pytest-alerts/discussions)\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for version history and changes.\n",
    "bugtrack_url": null,
    "license": "pytest-alerts License\n        \n        Copyright (c) 2025 Nikola\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, and distribute the Software, subject to\n        the following conditions:\n        \n        1. The above copyright notice and this permission notice shall be included in all\n           copies or substantial portions of the Software.\n        \n        2. Commercial Use Restriction:\n           The Software and any modifications thereof may not be sold, licensed, or\n           otherwise distributed for a fee or commercial gain without explicit written\n           permission from the copyright holder. This includes, but is not limited to:\n           - Selling the Software as a standalone product\n           - Including the Software as part of a commercial product\n           - Offering the Software as a paid service\n           - Reselling modified versions of the Software\n        \n        3. Permitted Uses:\n           - Personal use\n           - Educational use\n           - Non-commercial organization use\n           - Internal use in commercial organizations (where the Software is used but not sold)\n           - Contributing improvements back to the original project\n        \n        4. Attribution Requirement:\n           Any distribution of the Software or modified versions must maintain attribution\n           to the original author and project.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        \n        For commercial licensing inquiries, please contact: nikolaoutwork@gmail.com",
    "summary": "A pytest plugin for sending test results to Slack and Telegram",
    "version": "1.3.0",
    "project_urls": {
        "Changelog": "https://github.com/nikolaout/pytest-alerts/blob/main/CHANGELOG.md",
        "Documentation": "https://github.com/nikolaout/pytest-alerts#readme",
        "Homepage": "https://github.com/nikolaout/pytest-alerts",
        "Issues": "https://github.com/nikolaout/pytest-alerts/issues",
        "Repository": "https://github.com/nikolaout/pytest-alerts.git"
    },
    "split_keywords": [
        "alerts",
        " notifications",
        " pytest",
        " slack",
        " telegram"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f42749049d487939978cf47365d824129ad7832f6f77f633144b89b8c0bcee47",
                "md5": "89bcdd92fb3c5dda805a70b6ab817fda",
                "sha256": "8eeaf0fc83db506129f2d41e62ce02f127c6b549830003b6604e98e46a1d43c6"
            },
            "downloads": -1,
            "filename": "pytest_alerts-1.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "89bcdd92fb3c5dda805a70b6ab817fda",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 9878,
            "upload_time": "2025-01-28T07:12:51",
            "upload_time_iso_8601": "2025-01-28T07:12:51.029358Z",
            "url": "https://files.pythonhosted.org/packages/f4/27/49049d487939978cf47365d824129ad7832f6f77f633144b89b8c0bcee47/pytest_alerts-1.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "08dfa9c1458a7e20521c5967f1a4b39eda1310068a061a40e599666e6f32f4da",
                "md5": "c8a3705d56e8efba1edb1e5f161e20b8",
                "sha256": "b6c5c86fab3893ae9366ab716acae0f13fe254c30ebea19185a746847a4acc31"
            },
            "downloads": -1,
            "filename": "pytest_alerts-1.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c8a3705d56e8efba1edb1e5f161e20b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7827,
            "upload_time": "2025-01-28T07:12:52",
            "upload_time_iso_8601": "2025-01-28T07:12:52.096513Z",
            "url": "https://files.pythonhosted.org/packages/08/df/a9c1458a7e20521c5967f1a4b39eda1310068a061a40e599666e6f32f4da/pytest_alerts-1.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-28 07:12:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nikolaout",
    "github_project": "pytest-alerts",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pytest",
            "specs": [
                [
                    ">=",
                    "7.4.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.26.0"
                ]
            ]
        },
        {
            "name": "black",
            "specs": [
                [
                    ">=",
                    "22.3.0"
                ]
            ]
        },
        {
            "name": "pytest-cov",
            "specs": [
                [
                    ">=",
                    "6.0.0"
                ]
            ]
        },
        {
            "name": "build",
            "specs": [
                [
                    ">=",
                    "1.2.2.post1"
                ]
            ]
        },
        {
            "name": "twine",
            "specs": [
                [
                    ">=",
                    "6.1.0"
                ]
            ]
        }
    ],
    "lcname": "pytest-alerts"
}
        
Elapsed time: 0.94754s