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)