Provide an easy way to test sending of signals
Currently, when writing tests for an application that sends signals, there's no easy built-in way to test the sending of signals.
A simple solution would be to add a context-manager assertion that can check a signal was sent and received keyword arguments with certain names, and then further inspection of the received arguments could be done inside the with
block. For example:
with self.AssertSignalSent(some_signal, required_kwargs=['my_kwarg']):
# ...do stuff...
Change History
(9)
Triage Stage: |
Unreviewed → Accepted
|
Version: |
1.10 → master
|
Owner: |
changed from nobody to James Bennett
|
Status: |
new → assigned
|
Has patch: |
set
|
Patch needs improvement: |
set
|
Triage Stage: |
Accepted → Ready for checkin
|
Patch needs improvement: |
unset
|
Triage Stage: |
Ready for checkin → Accepted
|
Triage Stage: |
Accepted → Ready for checkin
|
Patch needs improvement: |
set
|
Triage Stage: |
Ready for checkin → Accepted
|
Owner: |
James Bennett removed
|
Status: |
assigned → new
|
Cc: |
Ülgen Sarıkavak added
|
WIP PR