run_toastertests.py 文件源码

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

项目:isar 作者: ilbers 项目源码 文件源码
def buildResultClass(args):
    """Build a Result Class to use in the testcase execution"""

    class StampedResult(unittest.TextTestResult):
        """
        Custom TestResult that prints the time when a test starts.  As toaster-auto
        can take a long time (ie a few hours) to run, timestamps help us understand
        what tests are taking a long time to execute.
        """
        def startTest(self, test):
            import time
            self.stream.write(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + " - ")
            super(StampedResult, self).startTest(test)

    return StampedResult
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号