Commit 703f87ce authored by Alexandre Vassalotti's avatar Alexandre Vassalotti

Clean up test_curses.

By using __stdout__ directly, test_curses caused regrtest.py
to duplicate the output of some test results.
parent 09debe46
...@@ -269,16 +269,17 @@ def main(stdscr): ...@@ -269,16 +269,17 @@ def main(stdscr):
finally: finally:
curses.resetty() curses.resetty()
if __name__ == '__main__': def test_main():
curses.wrapper(main)
unit_tests()
else:
# testing setupterm() inside initscr/endwin # testing setupterm() inside initscr/endwin
# causes terminal breakage # causes terminal breakage
curses.setupterm(fd=sys.__stdout__.fileno()) curses.setupterm(fd=sys.stdout.fileno())
try: try:
stdscr = curses.initscr() stdscr = curses.initscr()
main(stdscr) main(stdscr)
finally: finally:
curses.endwin() curses.endwin()
unit_tests() unit_tests()
if __name__ == '__main__':
curses.wrapper(main)
unit_tests()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment