asynctest.py 文件源码

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

项目:aioprometheus 作者: claws 项目源码 文件源码
def addCleanup(self, function, *args, **kwargs):
        '''
        Add a function, with arguments, to be called when the test is
        completed. If function is a coroutine function, it will be run by the
        event loop before it is destroyed.
        '''
        if asyncio.iscoroutinefunction(function):
            return super().addCleanup(self.loop.run_until_complete,
                                      function(*args, **kwargs))

        return super().addCleanup(function, *args, **kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号