This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients serhiy.storchaka, twouters
Date 2020-12-30.19:06:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org>
In-reply-to
Content
Currently many tests in test_curses are skipped if sys.__stdout__ is not attached to terminal. All tests are ran only when run them manually, and without using pager. This leads to passing bugs, like in issue42694.

The proposed PR makes tests always ran. If __stdout__ is not attached to terminal, it tries to attach it to terminal, using __stderr__ if it is attached to terminal, or opening /dev/tty. If neither __stdout__ nor __stderr__ are attached to terminal, it tries to use temporary file, but some functions do not work in this case and will be untested.

It could be better to use os.openpty(), but too many curses outputs can overflow the buffer (2 KiB) and cause the test and all subsequent tests to fail. Currently all tests are passed if use os.openpty(), but I afraid that adding more tests will overflow the buffer and it will confuse future developers. My attempts to solve this issue was unsuccessful for that time, so I left more complicated and less flexible, but more reliable solution.
History
Date User Action Args
2020-12-30 19:06:35serhiy.storchakasetrecipients: + serhiy.storchaka, twouters
2020-12-30 19:06:35serhiy.storchakasetmessageid: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org>
2020-12-30 19:06:35serhiy.storchakalinkissue42789 messages
2020-12-30 19:06:35serhiy.storchakacreate