
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
A pytest plugin for sending a desktop notification and playing a sound upon completion of tests
.. Badges have empty alts. So nothing shows up if they do not work. .. This fixes readthedocs issues with badges. .. image:: https://img.shields.io/pypi/v/pytest-notification.svg :target: https://pypi.org/project/pytest-notification/ :alt:
.. image:: https://img.shields.io/conda/v/conda-forge/pytest-notification.svg :target: https://anaconda.org/conda-forge/pytest-notification :alt:
.. image:: https://img.shields.io/pypi/pyversions/pytest-notification.svg :target: https://pypi.org/project/pytest-notification/ :alt:
.. image:: https://img.shields.io/pypi/l/pytest-notification.svg :target: https://github.com/rhpvorderman/pytest-notification/blob/master/LICENSE :alt:
.. image:: https://travis-ci.org/rhpvorderman/pytest-notification.svg?branch=develop :target: https://travis-ci.org/rhpvorderman/pytest-notification :alt:
.. image:: https://codecov.io/gh/rhpvorderman/pytest-notification/branch/develop/graph/badge.svg :target: https://codecov.io/gh/rhpvorderman/pytest-notification :alt:
A plugin for pytest that sends notifications if a --notify
flag is passed
to pytest on the command line. It plays sounds when a --sound
or
--play-sound
flag is passed.
The notifications and sounds are different depending whether the test run has passed or failed.
The messages and sounds are only played when the flags are passed. This allows you to turn it on only for those tests for which you expect a long time is needed.
pytest-notifier <https://github.com/ratson/pytest-notifier>
_ always sends
a notification. It can be turned of with --notify-off
. This is a
fundamentally different design choice, which is why this package was created.
Pytest-notifier has been around for a long time and is still being actively
maintained. It does not support playing sounds, but it does support Mac OS X
notifications.
=================================== =======
option usage
=================================== =======
--notify
Sends a desktop notification when pytest is finished. (Only implemented on Linux. Requires the 'notify-send' program in PATH on Linux.
--sound
, --play-sound
Plays a sound when pytest is finished. (Only implemented on Linux and Macintosh systems).
--disturb
shorthand for --notify --sound
=================================== =======
pytest-notification can be installed with pip install pytest-notification
.
On Linux notifications are supported via the notify-send
program. On Debian,
Ubuntu and derived distros this is available in the libnotify-bin
package.
On Linux sound is supported via the paplay
program. On Debian, Ubuntu and
derived distros this available in the pulseaudio-utils
pacakge.
The installation for Ubuntu should be:
.. code-block:: bash
sudo apt update
sudo apt install libnotify-bin pulseaudio-utils
pip install pytest-notification
On Mac OS X sound is implemented via the afplay
program, which should be
installed by default. Since I do not own a mac I can not test this feature.
pull requests are welcome.
On Mac OS X notifications are not supported.
Alternatively you could take a look at pytest-notifier <https://github.com/ratson/pytest-notifier>
_, which does support Mac OS X.
Windows is not supported.
Pull requests for improved Mac and Windows support are welcome. As well as ideas
and other pull requests. Simply create a new issue or PR on the github page <https://github.com/rhpvorderman/pytest-notification>
_.
In theory the winsound
module could be used to
play sounds, but this only supports wave files. These are very big and
cumbersome to distribute. I have not actively looked for a way to create a
message on windows. There will probably be some powershell command that can
pull this off. Pull requests are welcome.
FAQs
A pytest plugin for sending a desktop notification and playing a sound upon completion of tests
We found that pytest-notification demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.