depricated_test_filedescriptor.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:tools 作者: InfraSIM 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号