#NEWLINE# def test_enable_disable( self ) : #NEWLINE# #INDENT# lp = LineProfiler ( ) #NEWLINE# self . assertEqual ( lp . enable_count , 0 ) #NEWLINE# lp . enable_by_count ( ) #NEWLINE# self . assertEqual ( lp . enable_count , 1 ) #NEWLINE# lp . enable_by_count ( ) #NEWLINE# self . assertEqual ( lp . enable_count , 2 ) #NEWLINE# lp . disable_by_count ( ) #NEWLINE# self . assertEqual ( lp . enable_count , 1 ) #NEWLINE# lp . disable_by_count ( ) #NEWLINE# self . assertEqual ( lp . enable_count , 0 ) #NEWLINE# self . assertEqual ( lp . last_time , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# lp . disable_by_count ( ) #NEWLINE# self . assertEqual ( lp . enable_count , 0 ) #NEWLINE# with lp : #NEWLINE# #INDENT# self . assertEqual ( lp . enable_count , 1 ) #NEWLINE# with lp : #NEWLINE# #INDENT# self . assertEqual ( lp . enable_count , 2 ) #NEWLINE# #UNINDENT# self . assertEqual ( lp . enable_count , 1 ) #NEWLINE# #UNINDENT# self . assertEqual ( lp . enable_count , 0 ) #NEWLINE# self . assertEqual ( lp . last_time , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# with self . assertRaises ( RuntimeError ) : #NEWLINE# #INDENT# self . assertEqual ( self . enable_count , 0 ) #NEWLINE# with lp : #NEWLINE# #INDENT# self . assertEqual ( lp . enable_count , 1 ) #NEWLINE# raise RuntimeError ( ) #NEWLINE# #UNINDENT# #UNINDENT# self . assertEqual ( lp . enable_count , 0 ) #NEWLINE# self . assertEqual ( lp . last_time , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } )