Message384083
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. |
|
Date |
User |
Action |
Args |
2020-12-30 19:06:35 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, twouters |
2020-12-30 19:06:35 | serhiy.storchaka | set | messageid: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> |
2020-12-30 19:06:35 | serhiy.storchaka | link | issue42789 messages |
2020-12-30 19:06:35 | serhiy.storchaka | create | |
|