#NEWLINE# def test_logging_on_failed_processing_can_be_turned_off( self ) : #NEWLINE# #INDENT# consumer = self . _create_consumer ( processor = 'test_processor' , connection = 'test_connection' , log_processor_exceptions = False ) #NEWLINE# mocked_processor = mock . Mock ( name = 'processor' ) #NEWLINE# consumer . processor_dependency . on_resource_ready ( self ) #NEWLINE# mocked_processor . return_value = failure . Failure ( Exception ( 'test exception' ) ) #NEWLINE# with patch . object ( providers . logger , 'warn' ) as mocked_warn : #NEWLINE# #INDENT# mocked_method = mock . Mock ( name = 'method' ) #NEWLINE# consumer . _process ( mock . Mock ( name = 'channel' ) , mocked_method , mock . Mock ( name = 'properties' ) , 'test message body' ) #NEWLINE# self . assertEquals ( mocked_processor . call_count , 1 ) #NEWLINE# self . assertEquals ( mocked_warn . call_count , 0 )