Giter Site home page Giter Site logo

pytest-dev / pytest-messenger Goto Github PK

View Code? Open in Web Editor NEW
67.0 25.0 15.0 1.74 MB

Pytest-messenger report plugin for all popular messengers like: Slack, DingTalk, Telegram

Home Page: https://pypi.org/project/pytest-messenger

License: MIT License

Python 91.83% Makefile 8.17%
pytest pytest-plugin slack slack-webhook dingtalk dingtalk-robot dingtalk-python

pytest-messenger's Introduction

pytest-messenger

ex pytest-slack

image

image

Updates

Pytest to IM reporting plugin

Supported messengers and links to the usage:

image

Requirements

  • Requests
  • Python >= 3.6

Installation

You can install "pytest-messenger" via pip:

$ pip install pytest-messenger

Issues

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

Credits

[ ~ Dependencies scanned by PyUp.io ~ ]

pytest-messenger's People

Contributors

awegnergithub avatar dmpe avatar laserphaser avatar lithammer avatar mstevens avatar nrccua-bradb avatar polamikhail avatar pyup-bot avatar repsejnworb avatar thombashi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pytest-messenger's Issues

Add verbosity level

Add verbosity level to report pytest details to the slack channel.
Verbosity level must be added as an options (--slack_verbose=[1...3])
Levels:

  1. only red/green label
  2. #1 + number of failed/passsed/skipped/errored tests
  3. #2 + default pytests output as attachment

unrecognized arguments for slack hook

Here's my sample command:
docker-compose exec storage-test py.test --slack_hook=https://hooks.slack.com/services/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 tests/bma/cloud/test_cloud_search.py::test_basic_search_default_query
usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: unrecognized arguments: --slack_hook=https://hooks.slack.com/services/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
inifile: None
rootdir: /code

There is no space between py.test --slack_hook as the copy would imply

ERROR: File not found

Hello, and thanks for this very useful package :)

I'm having problems to run it for the first time:
I copied the example from the documentation, and also tried existing users and channels, but always get the same error on the hook.

For the hook, if I use the cURL example provided by Slack, it works fine.
I created a basic slack hook with "Incoming Webhooks, Bots and Permissions enabled".

this error I see

pytest test_main_page.py  –slack_hook=https://hooks.slack.com/services/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 –slack_channel=test_report_channel –slack_username=”Regression testing results”
==================================================================== test session starts ====================================================================
platform darwin -- Python 3.7.2, pytest-5.3.5, py-1.7.0, pluggy-0.13.1
rootdir: /Users/myuser/website-tests
plugins: xdist-1.26.0, timeout-1.3.3, teamcity-messages-1.21, rerunfailures-8.0, curl-report-0.5.4, slack-2.2.0, forked-1.0.1
collected 0 items                                                                                                                                           

=================================================================== no tests ran in 0.01s ===================================================================
ERROR: file not found: –slack_hook=https://hooks.slack.com/services/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igwo

any ideas? thanks!

emoji/icon is not shown with the message

the default thumbsup and thumbsdown does not appear in the slack message.

Setup: python 3.8, pytest-slack 2.3.1
Command: python -m pytest -vv -x scan.py --slack_hook=${SLACK_NBE_WEBHOOK}

Allow adding some text to the message

I can see that we cannot change the username or icon for slack anymore #125. But what we simply need is to add the test name. For example API, UI, etc.

So adding some header or test element to the body will really help. For example:

Daily API test: Passed=1 Failed=0 Skipped=0 Error=0 XFailed=0 XPassed=0

Execution Time

I would like to report how much time it takes to execute the tests as well. I know I could open the reports to view the amount of time it took to execute the test, but this library is such a nice way to quickly view high-level details, I would love to see one more result included.

Please let me know if more clarity is needed or if I need to provide additional details.

Thank you.

Detailed Failure message capture

Is there a way to capture the Failure reason for the test case along with the test name? Currently it only gives number of passed and failed test cases as below.

Passed=3 Failed=1 Skipped=0 Error=0 XFailed=0 XPassed=0

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Version 3.1.0 installs on Python 2.7 but fails running

Two issues:

  • pip installs pytest-messenger 3.1.0 on Python 2.7 even though that version does not run there (it fails in plugins.py line 13 on the type declarations that require Python 3.6 or higher and that were introduced in version 3.1.0 of the package). Pip does this because the package does not declare its supported Python versions using the python_requires argument of setup().
    Solution: Add a python_requires='>=3.6' argument to setup() in setup.py.

  • The Python versions stated in the "Programming Language" Trove classifiers still include Python 2.7 which is incorrect (Note that the Trove classifiers are not used by Pip to decide about Python version support).
    Solution: Remove Python 2.7 from the classifiers argument of setup() in setup.py.

Multiple Notifications are sent to Slack

Hi,

I just tried using this library and in a suite of 17 tests I got 4 notifications, seems like a progress notifications.
image

I'd like to have only one single notification at the end of all tests. Any way I can configure that?

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Pytest-slack not Posting to Slack channel when using Pycharm Run option

"version": "==2.3.1"

I have my pytest.ini file configured to post my pytest results to a specific Slack channel, however, when I use the "Run" option in Pycharm my results are not being posted. But if I execute my tests from terminal, the report status is posted in the correct channel.

Before updating to this current version of pytest-slack, this was not an issue (2.2.4).

Not sure if this is a pytest-slack issue, or a Pycharm issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.