def teardown_gateways(self, reporter, channels): for channel in channels: #try: try: repevent.wrapcall(reporter, channel.waitclose, 1) except IOError: # timeout # force closing channel.close() channel.gateway.exit()
def test_wrapcall_ok(): l = [] def ok(x): return x+1 i = repevent.wrapcall(l.append, ok, 1) assert i == 2 assert len(l) == 2 assert isinstance(l[0], repevent.CallStart) assert isinstance(l[1], repevent.CallFinish) assert repr(l[0]) assert repr(l[1])