def disconnect_all(signal=Any, sender=Any): """Disconnect all signal handlers. Useful for cleaning up after running tests """ for receiver in liveReceivers(getAllReceivers(sender, signal)): disconnect(receiver, signal=signal, sender=sender)
def disconnect(self, *a, **kw): kw.setdefault('sender', self.sender) return dispatcher.disconnect(*a, **kw)