On Wed, Jul 12, 2000 at 09:50:54AM -0500, Skip Montanaro wrote: > I decided I better examine the posix.isatty patch assigned to me before > Guido kicks me out... I was a little annoyed it didn't include a new test > case. I wasn't entirely certain how to test this. Can we rely on stdin/stdout being a terminal, inside tests ? I think not. It can be tested by test_pty and/or test_openpty, but then failure can mean two things: pty.openpty() failed, or isatty() failed. Or we can open an fd and make sure os.isatty() returns 0 for that. None of it seemed very sensible. (I did write the test_pty/test_openpty modules with this in mind, though: ## # Please uncomment these if os.isatty() is added. ## if not os.isatty(master_fd): ## raise TestFailed, "master_fd is not a tty" ## if not os.isatty(slave_fd): ## raise TestFailed, "slave_fd is not a tty" So if you accept the patch, please uncomment those lines ;) However, isatty() is a *very* simple wrapper around a very basic C function, so I didn't think it warranted a test case. (Like you pointed out, none of the other functions in posixmodule have test cases.) -- Thomas Wouters <thomas@xs4all.net> Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4