Clean up test_curses.

By using __stdout__ directly, test_curses caused regrtest.py
to duplicate the output of some test results.
This commit is contained in:
Alexandre Vassalotti 2009-07-22 21:27:53 +00:00
parent c7e994d009
commit 5ff02352e8
1 changed files with 6 additions and 5 deletions

View File

@ -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()