#NEWLINE# def testCatchBreakInstallsHandler( self ) : #NEWLINE# #INDENT# module = sys . modules [ 'unittest2.main' ] #NEWLINE# original = module . installHandler #NEWLINE# def restore( ) : #NEWLINE# #INDENT# module . installHandler = original #NEWLINE# #UNINDENT# self . addCleanup ( restore ) #NEWLINE# self . installed = False #NEWLINE# def fakeInstallHandler( ) : #NEWLINE# #INDENT# self . installed = True #NEWLINE# #UNINDENT# module . installHandler = fakeInstallHandler #NEWLINE# program = self . program #NEWLINE# program . catchbreak = True #NEWLINE# program . testRunner = FakeRunner #NEWLINE# program . runTests ( ) #NEWLINE# self . assertTrue ( self . installed )