#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def test_logging( self ) : #NEWLINE# #INDENT# crawler = get_crawler ( _HttpErrorSpider ) #NEWLINE# with LogCapture ( ) as log : #NEWLINE# #INDENT# ( yield crawler . crawl ( bypass_status_codes = { 402 } ) ) #NEWLINE# #UNINDENT# self . assertEqual ( crawler . spider . parsed , { '200' , '402' } ) #NEWLINE# self . assertEqual ( crawler . spider . skipped , { '402' } ) #NEWLINE# self . assertEqual ( crawler . spider . failed , { '404' , '500' } ) #NEWLINE# self . assertIn ( 'Ignoring response <404' , str ( log ) ) #NEWLINE# self . assertIn ( 'Ignoring response <500' , str ( log ) ) #NEWLINE# self . assertNotIn ( 'Ignoring response <200' , str ( log ) ) #NEWLINE# self . assertNotIn ( 'Ignoring response <402' , str ( log ) )