diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2009-07-22 21:27:53 (GMT) |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2009-07-22 21:27:53 (GMT) |
commit | 5ff02352e8c85d377b0e76d47b8a5899eb683f50 (patch) | |
tree | 2aca877916a3bf3dcd800bc3a36b4ec74aa0b13f | |
parent | c7e994d00976f3890406394c8f23804b245b2693 (diff) | |
download | cpython-5ff02352e8c85d377b0e76d47b8a5899eb683f50.zip cpython-5ff02352e8c85d377b0e76d47b8a5899eb683f50.tar.gz cpython-5ff02352e8c85d377b0e76d47b8a5899eb683f50.tar.bz2 |
Clean up test_curses.
By using __stdout__ directly, test_curses caused regrtest.py
to duplicate the output of some test results.
-rw-r--r-- | Lib/test/test_curses.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index bf60daa..4be2029 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -269,16 +269,17 @@ def main(stdscr): finally: curses.resetty() -if __name__ == '__main__': - curses.wrapper(main) - unit_tests() -else: +def test_main(): # testing setupterm() inside initscr/endwin # causes terminal breakage - curses.setupterm(fd=sys.__stdout__.fileno()) + curses.setupterm(fd=sys.stdout.fileno()) try: stdscr = curses.initscr() main(stdscr) finally: curses.endwin() unit_tests() + +if __name__ == '__main__': + curses.wrapper(main) + unit_tests() |