#NEWLINE# def test_print_tracebacks( self ) : #NEWLINE# #INDENT# def f( ) : #NEWLINE# #INDENT# ( 1 / 0 ) #NEWLINE# #UNINDENT# def g( ) : #NEWLINE# #INDENT# ( 1 / 0 ) #NEWLINE# #UNINDENT# def h( ) : #NEWLINE# #INDENT# ( 1 / 0 ) #NEWLINE# #UNINDENT# atexit . register ( f ) #NEWLINE# atexit . register ( g ) #NEWLINE# atexit . register ( h ) #NEWLINE# self . assertRaises ( ZeroDivisionError , atexit . _run_exitfuncs ) #NEWLINE# stderr = self . stream . getvalue ( ) #NEWLINE# self . assertEqual ( stderr . count ( 'ZeroDivisionError' ) , 3 ) #NEWLINE# self . assertIn ( '# one' , stderr ) #NEWLINE# self . assertIn ( '# two' , stderr ) #NEWLINE# self . assertIn ( '# three' , f )