#NEWLINE# @ mock . patch ( 'pep8._checks' , { #NEWLINE# #INDENT# 'physical_line' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'logical_line' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'tree' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# def _run_check( self , code , checker , filename = None ) : #NEWLINE# #INDENT# pep8 . register_check ( checker ) #NEWLINE# lines = textwrap . dedent ( code ) . strip ( ) . splitlines ( True ) #NEWLINE# checker = pep8 . Checker ( filename = lines , lines = lines ) #NEWLINE# checker . check_all ( ) #NEWLINE# checker . report . _deferred_print . sort ( ) #NEWLINE# return checker . report . _deferred_print