标签:ledir except python discover script div load rtl default
def run_t():
    try:
        log = InsertLog_P()
        dirpath = ‘./scripts‘
        discover = unittest.defaultTestLoader.discover(dirpath,pattern=‘*_tc.py‘)
        suite = get_test_case(discover)
        ct = time.strftime(‘%y%m%d%H%M%S ‘)
        filedir = ‘./reports/‘ + ‘report‘ + ct + ‘.html‘
        fp = open(filedir,‘w‘)
        runner = HTMLTestRunner(stream=fp,title=u‘test‘,description=u‘description‘ )
        runner.run(suite)
        fp.close()
        log.info(u"脚本成功运行")
    except BaseException as msg:
        log.error(msg)
标签:ledir except python discover script div load rtl default
原文地址:https://www.cnblogs.com/hai-peng/p/9501561.html