#NEWLINE# def test_before_import( self ) : #NEWLINE# #INDENT# invoked = [ ] #NEWLINE# @ wrapt . when_imported ( 'this' ) #NEWLINE# def hook_this( module ) : #NEWLINE# #INDENT# self . assertEqual ( module . __name__ , 'this' ) #NEWLINE# invoked . append ( 1 ) #NEWLINE# #UNINDENT# self . assertEqual ( len ( invoked ) , 0 ) #NEWLINE# import this #NEWLINE# self . assertEqual ( len ( self ) , 1 )