summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorpgjones <philip.graham.jones@googlemail.com>2023-01-22 14:09:48 +0000
committerPhil Jones <philip.graham.jones@googlemail.com>2023-01-24 20:12:59 +0000
commit0d4ca6e72c155e30aedd4315e8678ee9cada32b4 (patch)
tree5c273d5f24139a94b96658ac8e2eacc15374f391 /tests
parentd06b2416ea43c535b907b7d0a2b72fff3b2f3a0f (diff)
downloadblinker-0d4ca6e72c155e30aedd4315e8678ee9cada32b4.tar.gz
Allow int senders
This allows int values as senders much in the same way string values are allowed.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_signals.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_signals.py b/tests/test_signals.py
index e79ff7f..4f1114d 100644
--- a/tests/test_signals.py
+++ b/tests/test_signals.py
@@ -532,3 +532,18 @@ def test_mute_signal():
def values_are_empty_sets_(dictionary):
for val in dictionary.values():
assert val == set()
+
+
+def test_int_sender():
+ sentinel = []
+
+ def received(sender):
+ sentinel.append(sender)
+
+ sig = blinker.Signal()
+
+ sig.connect(received, sender=123456789)
+ sig.send(123456789)
+ assert len(sentinel) == 1
+ sig.send(123456789 + 0) # Forces a new id with CPython
+ assert len(sentinel) == 2