test_atexit: fix code saving/restoring stdout and stderr
That's why I prefer a single instruction per line :-)
This commit is contained in:
parent
73efd621fb
commit
457ab068a3
|
@ -25,8 +25,9 @@ def raise2():
|
|||
|
||||
class TestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.save_stdout = sys.stdout
|
||||
self.save_stderr = sys.stderr
|
||||
self.stream = io.StringIO()
|
||||
self.save_stdout, self.save_stderr = sys.stderr, sys.stdout
|
||||
sys.stdout = sys.stderr = self.stream
|
||||
atexit._clear()
|
||||
|
||||
|
|
Loading…
Reference in New Issue