test_async.py 文件源码

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

项目:chainerrl 作者: chainer 项目源码 文件源码
def test_run_async_exit_code(self):

        def run_with_exit_code_0(process_idx):
            sys.exit(0)

        def run_with_exit_code_11(process_idx):
            os.kill(os.getpid(), signal.SIGSEGV)

        with warnings.catch_warnings(record=True) as w:
            async.run_async(4, run_with_exit_code_0)
            # There should be no warnings
            assert len(w) == 0

        with warnings.catch_warnings(record=True) as w:
            async.run_async(4, run_with_exit_code_11)
            # There should be 4 warnings
            assert len(w) == 4
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号