#NEWLINE# def test_decorator( self ) : #NEWLINE# #INDENT# @ benchmarked ( ) #NEWLINE# def foobar( ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# for _ in range ( 10 ) : #NEWLINE# #INDENT# foobar ( ) #NEWLINE# #UNINDENT# self . assertIsInstance ( benchmarked . _results [ None ] [ 'foobar' ] , list ) #NEWLINE# self . assertIsInstance ( benchmarked . _results [ None ] [ 'foobar' ] [ 0 ] , tuple ) #NEWLINE# self . assertIsInstance ( benchmarked . _results [ None ] [ 'foobar' ] [ 0 ] [ 0 ] , float ) #NEWLINE# results = benchmarked . results ( 'foobar' ) #NEWLINE# self . assertIsInstance ( results , numpy . ndarray ) #NEWLINE# self . assertEqual ( 10 , len ( results ) ) #NEWLINE# self . assertEqual ( len ( getrusage ( RUSAGE_SELF ) ) , len ( foobar [ 0 ] ) ) #NEWLINE# statistics = benchmarked . statistics ( 'foobar' ) #NEWLINE# self . assertIn ( 'min' , statistics ) #NEWLINE# self . assertIsInstance ( statistics [ 'min' ] , numpy . ndarray ) #NEWLINE# self . assertEqual ( len ( getrusage ( RUSAGE_SELF ) ) , len ( statistics [ 'min' ] ) )