def test_around(self): """ Interceptor only has an enter and leave function. """ interceptors = [ tracer('a'), around(tracing('enter', 'b'), tracing('leave', 'b')), tracer('c') ] self.assertThat( execute(empty_context, interceptors), succeeded( Traced( Equals( v(('enter', 'a'), ('enter', 'b'), ('enter', 'c'), ('leave', 'c'), ('leave', 'b'), ('leave', 'a'))))))
def _swallow(marker): return lambda context, error: tracing('error', ( marker, 'from', error.failure.value.source))(context)