FakeSignal should stub connect_via method

This commit is contained in:
David Baumgold 2019-05-19 11:16:53 -04:00 committed by David Lord
parent d3e1fed777
commit fcf2eb4753
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
2 changed files with 10 additions and 9 deletions

View file

@ -32,19 +32,18 @@ except ImportError:
self.name = name
self.__doc__ = doc
def send(self, *args, **kwargs):
pass
def _fail(self, *args, **kwargs):
raise RuntimeError(
"signalling support is unavailable "
"because the blinker library is "
"not installed."
"Signalling support is unavailable because the blinker"
" library is not installed."
)
send = lambda *a, **kw: None
connect = (
disconnect
) = (
has_receivers_for
) = receivers_for = temporarily_connected_to = connected_to = _fail
connect = connect_via = connected_to = temporarily_connected_to = _fail
disconnect = _fail
has_receivers_for = receivers_for = _fail
del _fail