summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPhil Jones <philip.graham.jones@googlemail.com>2023-01-23 23:00:32 +0000
committerGitHub <noreply@github.com>2023-01-24 00:00:32 +0100
commitd06b2416ea43c535b907b7d0a2b72fff3b2f3a0f (patch)
tree566da903678855496ab9d691f229edc2bf89c917 /docs
parent9c2f289f024e7aac20bf3dbdebfc4ec279df3458 (diff)
downloadblinker-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.rst13
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
-----------------