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)
评论列表
文章目录