diff options
author | Phil Jones <philip.graham.jones@googlemail.com> | 2023-01-23 23:00:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-24 00:00:32 +0100 |
commit | d06b2416ea43c535b907b7d0a2b72fff3b2f3a0f (patch) | |
tree | 566da903678855496ab9d691f229edc2bf89c917 /docs | |
parent | 9c2f289f024e7aac20bf3dbdebfc4ec279df3458 (diff) | |
download | blinker-d06b2416ea43c535b907b7d0a2b72fff3b2f3a0f.tar.gz |
Added `muted` context manager for temproary switching signal off (#84)
This is useful whilst testing to remove a signal's affects.
Co-authored-by: Michael Elovskikh <wronglink@yandex-team.ru>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/index.rst b/docs/index.rst index 92b89ba..9c733bb 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -157,6 +157,19 @@ value``) pairs: [(<function receive_data at 0x...>, 'received!')] +Muting signals +-------------- + +To mute a signal, as may be required when testing, the +:meth:`~Signal.muted` can be used as a context decorator: + +.. code-block:: python + + sig = signal('send-data') + with sig.muted(): + ... + + Anonymous Signals ----------------- |