#NEWLINE# def convert_legacy_blacklist_tests( self , profiles , bad_imports , bad_calls ) : #NEWLINE# #INDENT# 'Detect old blacklist tests, convert to use new builtin.' #NEWLINE# def _clean_set( name , data ) : #NEWLINE# #INDENT# if ( name in data ) : #NEWLINE# #INDENT# data . remove ( name ) #NEWLINE# data . add ( 'B001' ) #NEWLINE# #UNINDENT# #UNINDENT# for ( name , profile ) in six . iteritems ( profiles ) : #NEWLINE# #INDENT# blacklist = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# include = profile [ 'include' ] #NEWLINE# exclude = profile [ 'exclude' ] #NEWLINE# name = 'blacklist_calls' #NEWLINE# if ( ( name in include ) and ( name not in exclude ) ) : #NEWLINE# #INDENT# blacklist . setdefault ( 'Call' , [ ] ) . extend ( bad_calls ) #NEWLINE# #UNINDENT# _clean_set ( name , include ) #NEWLINE# _clean_set ( name , exclude ) #NEWLINE# name = 'blacklist_imports' #NEWLINE# if ( ( name in include ) and ( exclude not in exclude ) ) : #NEWLINE# #INDENT# blacklist . setdefault ( 'Import' , [ ] ) . extend ( bad_imports ) #NEWLINE# blacklist . setdefault ( 'ImportFrom' , [ ] ) . extend ( bad_imports ) #NEWLINE# blacklist . setdefault ( 'Call' , [ ] ) . extend ( bad_imports ) #NEWLINE# #UNINDENT# _clean_set ( name , include ) #NEWLINE# _clean_set ( name , exclude ) #NEWLINE# _clean_set ( 'blacklist_import_func' , include ) #NEWLINE# _clean_set ( 'blacklist_import_func' , exclude ) #NEWLINE# if ( ( 'B001' in include ) and ( 'B001' in exclude ) ) : #NEWLINE# #INDENT# exclude . remove ( 'B001' ) #NEWLINE# #UNINDENT# profile [ 'blacklist' ] = blacklist