#NEWLINE# def test_run_raises( self ) : #NEWLINE# #INDENT# conn = ContextMock ( name = 'connection' ) #NEWLINE# self . c . connection = conn #NEWLINE# conn . connection_errors = ( KeyError , ) #NEWLINE# conn . channel_errors = ( ) #NEWLINE# consume = self . c . consume = Mock ( name = 'c.consume' ) #NEWLINE# with patch ( 'kombu.mixins.warn' ) as warn : #NEWLINE# #INDENT# def se_raises( * args , **kwargs ) : #NEWLINE# #INDENT# self . c . should_stop = True #NEWLINE# raise KeyError ( 'foo' ) #NEWLINE# #UNINDENT# self . c . should_stop = False #NEWLINE# consume . side_effect = se_raises #NEWLINE# self . c . run ( ) #NEWLINE# warn . assert_called ( )