test_system.py 文件源码

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

项目:FancyWord 作者: EastonLee 项目源码 文件源码
def test_pid_exists_2(self):
        reap_children()
        pids = psutil.pids()
        for pid in pids:
            try:
                assert psutil.pid_exists(pid)
            except AssertionError:
                # in case the process disappeared in meantime fail only
                # if it is no longer in psutil.pids()
                time.sleep(.1)
                if pid in psutil.pids():
                    self.fail(pid)
        pids = range(max(pids) + 5000, max(pids) + 6000)
        for pid in pids:
            self.assertFalse(psutil.pid_exists(pid), msg=pid)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号