Fix test_atexit so that it still passes when -3 is supplied. (It was catching the warning messages on stdio from using the reload() function.)

This commit is contained in:
Steven Bethard 2008-03-18 19:59:14 +00:00
parent f48da8fbcd
commit a7a3e28e4e

View file

@ -41,13 +41,13 @@ class TestCase(unittest.TestCase):
def test_sys_override(self):
# be sure a preset sys.exitfunc is handled properly
s = StringIO.StringIO()
sys.stdout = sys.stderr = s
save_handlers = atexit._exithandlers
atexit._exithandlers = []
exfunc = sys.exitfunc
sys.exitfunc = self.h1
reload(atexit)
s = StringIO.StringIO()
sys.stdout = sys.stderr = s
try:
atexit.register(self.h2)
atexit._run_exitfuncs()