def test_hide_show_exception_handling():
 try:
  with hide('stderr'):
   eq_(output.stderr, False)
   raise Exception
 except Exception:
  eq_(output.stderr, True)

def test_hide_show_exception_handling ( ) : try : with hide ( 'stderr' ) : eq_ ( output . stderr , False ) raise Exception except Exception : eq_ ( output . stderr , True )
hide()/show() should clean up ok if exceptions are raised .