Example #1
0
    def test_send (self):
        event1 = Event()
        event2 = Event()

        spawn(event1.send, 'hello event1')
        Timeout(0, ValueError('interrupted'))
        try:
            result = event1.wait()
        except ValueError:
            X = object()
            result = with_timeout(DELAY, event2.wait, timeout_value = X)
            assert result is X, 'Nobody sent anything to event2 yet it received %r' % (result, )
Example #2
0
 def func():
     return with_timeout(0.2, sleep, 2, timeout_value=1)
Example #3
0
 def func ():
     return with_timeout(0.2, sleep, 2, timeout_value = 1)