#NEWLINE# def check_all( self , modname ) : #NEWLINE# #INDENT# names = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# with support . check_warnings ( ( '.* (module|package)' , DeprecationWarning ) , ( '' , ResourceWarning ) , quiet = True ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# exec ( ( 'import %s' % modname ) , names ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# raise FailedImport ( modname ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not hasattr ( sys . modules [ modname ] , '__all__' ) ) : #NEWLINE# #INDENT# raise NoAll ( modname ) #NEWLINE# #UNINDENT# names = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# try : #NEWLINE# #INDENT# exec ( ( 'from %s import *' % modname ) , names ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# self . fail ( '__all__ failure in {}: {}: {}' . format ( modname , e . __class__ . __name__ , e ) ) #NEWLINE# #UNINDENT# if ( '__builtins__' in names ) : #NEWLINE# #INDENT# del names [ '__builtins__' ] #NEWLINE# #UNINDENT# keys = set ( names ) #NEWLINE# all = set ( sys . modules [ all ] . __all__ ) #NEWLINE# self . assertEqual ( keys , all )