def test_fd_isatty (self):
fd = os.open ('TESTDATA.txt', os.O_RDONLY)
s = pexpect.spawn (fd)
assert not s.isatty()
os.close(fd)
### def test_close_does_not_close_fd (self):
### '''Calling close() on a pexpect.spawn object should not
### close the underlying file descriptor.
### '''
### fd = os.open ('TESTDATA.txt', os.O_RDONLY)
### s = pexpect.spawn (fd)
### try:
### s.close()
### self.fail('Expected an Exception.')
### except pexpect.ExceptionPexpect, e:
### pass
depricated_test_filedescriptor.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录